aspose file tools*
The moose likes Servlets and the fly likes Is using servlets means using J2EE? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is using servlets means using J2EE?" Watch "Is using servlets means using J2EE?" New topic
Author

Is using servlets means using J2EE?

Annie Murray
Greenhorn

Joined: Jun 09, 2004
Posts: 4
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

Joined: Jan 10, 2002
Posts: 61434
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Annie Murray
Greenhorn

Joined: Jun 09, 2004
Posts: 4
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

Joined: Mar 22, 2000
Posts: 12806
    
    5
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

Joined: Oct 12, 2000
Posts: 5093
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.


42
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Good point guys - what I should have said is that you don't have to download the whole J2EE monster package.
Annie Murray
Greenhorn

Joined: Jun 09, 2004
Posts: 4
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

Joined: Aug 10, 2001
Posts: 3892
    
    5
Download Tomcat from http://jakarta.apache.org/tomcat/index.html. It is all you need.

Kyle
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
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

Joined: Nov 01, 2002
Posts: 363
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.


No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
 
Don't get me started about those stupid light bulbs.
 
subject: Is using servlets means using J2EE?