This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets Container

 
Rory Lynch
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently on OOP4 and I will be submitting my 3rd attempt as soon as I get home (and bath the kids and put them to bed and have some food).

So hopefully, with a little luck, i will be moving down the trail into Servlets creek.

I have had a look ahead and noticed that we are urged to download and install Orion. Over the last week I have downloaded J2EE and also Tomcat and I have just got familiar with the structure of Tomcat, I am also studying for the SCWCD exam and Head First Servlets and JSP recommends Tomcat.

Any objection to me doing the Servlets section of the cattle Drive using Tomcat as my development environment?
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No objection. Although officially the Cattle Drive is not yet using Tomcat, we are planning to switch. I'll send you a PM/email with more details.
 
Carol Murphy
village idiot
Bartender
Posts: 1202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the differences between Tomcat and Orion extreme?
 
Dick Summerfield
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carol,
I have recently installed Tomcat from a "sneak preview" of Marilyn's instructions. Installation went as smoothly as with Orion and the differences are minimal. I redid the Servlets 1 & 2 assignments under Tomcat just to see if they worked... (this guy must be nuts... ) again, no problems.

Probably the most intrusive difference with Tomcat is that it uses port 8080 instead of port 80 used by Orion. Port 80 is default so can be left out of a URL. With Tomcat you have to type:
http://localhost:8080/... but, OK, once it's in the "recently used list" one click suffices.
 
Daniel Loranz
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm stuck at compiling the example BeeServlet.java.

Here's what I've got ...

- MacBook Pro running OS X 10.5.4

- Tomcat is installed and running. I see the intro page when I point Safari to http://localhost:8080

- The included servlet examples and JSP examples are working. For example, date is behaving as expected.

- java -version at command line returns ...
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

Now when I compile BeeServlet.java, the compiler complains that ...
package javax.servlet.http does not exist

The compiler error message makes me think I need j2EE - to have the correct packages - but I'm really not sure. After all, Tomcat is described as a servlet container - so why do I need additional packages? (I have search JR discussions and googled as well - and am still not sure.)

Thanks for any help.
- Dan
 
Carol Murphy
village idiot
Bartender
Posts: 1202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file you are lacking is located on my system in C:\j2sdkee1.3.1\doc\api\javax\servlet\http.
So I guess you do need to download the enterprise stuff. I thought it was part of the instructions for setting up your system for the servlets, otherwise I would never have known to do it, (!) but I went back to look, and didn't see it mentioned anywhere. There is also an instruction to put a copy of tools.jar from your JDK into the orion directory. I don't know if tomcat requires that.
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Daniel Loranz:
Now when I compile BeeServlet.java, the compiler complains that ...
package javax.servlet.http does not exist

The compiler error message makes me think I need j2EE - to have the correct packages - but I'm really not sure. After all, Tomcat is described as a servlet container - so why do I need additional packages? (I have search JR discussions and googled as well - and am still not sure.)

Thanks for any help.
- Dan

1) I don't recommend compiling within the servlet container
2) Just because the servlet container uses J2EE doesn't mean that your source has access to those files.
3) I have sent you an email.
 
Daniel Loranz
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great - I've successfully compiled BeeServlet.java and see the results when I point my browser to the right spot. Thanks for the great help everyone.

While googling around for info about Tomcat I also came across JBoss and Sun GlassFish. From what I could tell, these all seemed similar, but not 100% overlapping. Any commentary on how these all relate would be very much appreciated.

Thanks!
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBoss uses Tomcat under the covers but has added layers to deal with EJBs. Tomcat, Orion, JRun, and other servlet containers have much in common. I don't know anything about GlassFish in particular.
 
Benjamin Hiner
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
GlassFish is Sun's reference implementation of J2EE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic