1

I am developing a web application using JSP, but it seems that Java EE is very big for my application. I'm only doing something like a blog.

Can I use a pure JSP and ignore Java EE and the JavaBean and start a pure JSP project?

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
Tattat
  • 15,548
  • 33
  • 87
  • 138
  • I can't write an web app using J2SE only? – Tattat Nov 23 '10 at 15:01
  • 1
    Time to clear up some terminology: the **current version** of "Java Enterprise" is _Java Enterprise Edition 6_, aka **Java EE 6**. The **J2EE** you're referring to is a confusingly-named previous version, _Java 2 Platform, Enterprise Edition_. Unless you're supporting legacy products, you don't want to write **J2EE** code these days. – Matt Ball Nov 23 '10 at 15:33

3 Answers3

3

JavaSE on its own is not sufficient to use JSP, you need at least some components of JavaEE. Specifically, you need a servlet container, such as Jetty or Tomcat.

Neither of these requires (or even contains) the rest of the baggage that comes with a full JavaEE stack.

skaffman
  • 398,947
  • 96
  • 818
  • 769
3

You don't need to download the huge Java EE packages as offered by sun.com/oracle.com. All it basically contains is the Glassfish server and eventually the Netbeans IDE. Glassfish is a fullfledged and heavyweight Java EE server.

The minimal requirement to develop and run JSP/Servlet is the following:

  • JDK (click the first Download JDK button) - about 75MB.
  • A JSP/Servlet container, I'd suggest Apache Tomcat - only about 7MB.

That's all. You have only to choose a development editor, which can be just Notepad. However to ease and speedup development, I'd recommend using an IDE like Eclipse for Java EE. It offers code completion, automatic builds (compilation), easy debugging, deploying to integrated server, etc.

That said, Javabeans is just a specification, say, a style of coding. Public classes with private properties and public getters/setters which represent real world data e.g. Person, User, Product, Order, etc. It doesn't require a download. You just have to write it yourself. However, to ease development and maintenance it's strongly recommend to use Javabeans in your code.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Glassfish is actually modular now. You still have to download everything but it only starts some components as you use them. That makes it less heavyweight than it used to be. – JOTN Nov 23 '10 at 16:39
1

There's no requirement you use all the features of the Java EE server. There's also stand-alone servlet containers like Apache Tomcat.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
JOTN
  • 6,120
  • 2
  • 26
  • 31