4

I know that J2EE can be used for JSP + Servlets. However, can I use J2SE for JSP & Servlets?

TechSpellBound
  • 2,505
  • 6
  • 25
  • 36
DNB5brims
  • 29,344
  • 50
  • 131
  • 195

3 Answers3

12

No, you can't. You need both the Java SE and a JSP/Servlet implementation (a web container), such as for example Apache Tomcat or Oracle GlassFish (which is also part of the Oracle Java EE download).

To be clear: you don't necessarily need to download the whole Java EE thing from Oracle in order to be able to develop webapps on Tomcat. Just the Java SE JDK is enough. The Java EE download is actually nothing else than Oracle's own (reference) implementation of the abstract Java EE specification, better known as "GlassFish", bundled with some documentation, examples and optionally the Netbeans IDE.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
10

J2EE is a set of APIs. JSPs and servlets are technologies and APIs within the J2EE domain. So I think that this question is a little confusing.

People often use J2EE as shorthand for EJBs and application containers (WebSphere/WebLogic etc.). Instead you can run up a servlet container (e.g. Tomcat/Jetty etc.) which handles web technologies but little else, using the standard J2SE with (say) the Servlet API and nothing else. I suspect that's what you're after.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
0

Servlet API is included both in Java EE and Java SE. So you can use it with Java SE. You will also need an application server.

Java application servers: http://en.wikipedia.org/wiki/Application_server#Java_application_servers

JCasso
  • 5,423
  • 2
  • 28
  • 42
  • But JCasso, the application servers are included under the Java EE domain as BalusC suggests. – TechSpellBound Apr 23 '12 at 08:52
  • @TechSpellBound: Not necessarily. I refer you to this question: http://stackoverflow.com/questions/3732109/simple-http-server-in-java-using-only-java-se-api –  Mar 19 '14 at 12:25
  • I am not sure about this. Yes you can have an HTTP server with Java SE, but servlet containers seem to ba a Java EE thing. http://www.oracle.com/technetwork/java/javaee/tech/index.html – galeop Dec 08 '16 at 13:09