Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is using servlets means using J2EE?

 
Annie Murray
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am new to java and this forum. I have very simple question do I need J2EE to use Servlets? Can I use servlets under j2Se or i have to have J2EE?

Thanks
Annie
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do not need the entire j2ee suite to run servlets. j2se will do fine since the servlet containers provide the jar file(s) needed to add the servlet and jsp APIs to your system.
 
Annie Murray
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks bear,

So what you mean is if a want to develop a simple 3 tier application where i give input using HTML form , run java servelts on web server which parses the data from HTMl form and form SQL statements to execute on the database and the the results are agin given back to servlet and it parses the data and produces the results in HTML format, so in order to do all this do i need J2EE or I can do using j2SE.

Thanks
annie
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right - all you need to run a simple 3tier system is a web server with servlet capability like Tomcat. Everybody agrees that J2EE is overkill for many applications. Servlets and JSP are the user interface technologies for larger J2EE applications so you will be learning the right APIs but with a much simpler system.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course effectively you DO need J2EE as the Servlet and JSP APIs are part of the J2EE specification now (they used to be separate but no more).

What you don't need is to download the entire J2EE package (though download at least the API docs, they come in really handy) if you have a servlet container installed and can link into its servlet jar.

Additional things you might like to use like JNDI are now also part of J2EE.

What you definitely do NOT need are EJBs, which are the cause of the main bloat of J2EE.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to echo Jeroen's point (and shame on you, Bill for confusing this poor woman!)

If you use Servlets (even in just a limited container like Tomcat) you ARE using J2EE because (as Jeroen's pointed out) the Servlet specifications are part of the J2EE specifications.

I think the point Bill and Bear are trying to make is that you don't HAVE to use all of the J2EE specifications (EJB, JMS, etc...) on any one project, and that it's perfectly acceptable to use a container (like Tomcat) that only implements a subset of them if that's all you need.

Does that clarify things?

Kyle
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good point guys - what I should have said is that you don't have to download the whole J2EE monster package.
 
Annie Murray
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Thanks a lot for all your help. Things are much clearer now. Though i have one question if I were to use servlets back in 1999 what would I have used J2EE(I think it was just released then) or J2SE.

Also can someone suggest what all I need to download to make a simple 3 tier application I discussed above.
I hope I am bugging everyone, But such small things do come in my mind and I dont have people around me to clear them for me.

Thanks
Annie
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Download Tomcat from http://jakarta.apache.org/tomcat/index.html. It is all you need.

Kyle
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
back in 1999 there was no J2EE (or it was in its infancy), only J2SDK and Servlet API as a standard extension.
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has something to do with the same misconception that venders and salespeople throw at me all the time. There is some idea out there that in order to be using J2EE you must be implementing EJBs or that using J2EE is synchronous with using EJBs. This is, in fact, false.

At this point, I'd like to thank all the large software vendors (no offense Kyle) for coming in and confusing the hell out of my pointy haired IT manager and tricking him into buying a bloated, resource intensive product that he doesn't need.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic