GeeCON Prague 2014*
The moose likes Servlets and the fly likes Path for Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Path for Servlets" Watch "Path for Servlets" New topic
Author

Path for Servlets

Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
Hi,
I have JDK in c:\jdk1.2.2 and Tomcat in C:\jakarta-tomcat.
Which is proper place(folder) to keep servlet files for testing?
Thanks
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
By default you can put your servlet, say ExampleServlet.class, into the folder(in your case):
C;\jakarta-tomcat\webapps\examples\WEB-INF\classes\
Then you can call your servlet in browser in this way: http://localhost:8080/examples/servlet/ExampleServlet
Of course you do not have to just put your servlet in above directory, but you have to change the .conf files and .xml files by yourself.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
However, there is an important point to consider.
If you want Tomcat to correctly deliver initialization parameters to your servlet, you must give it an alias entry in the web.xml file. We just went round&round about that on the Tomcat users mailing list.
Bill
 
GeeCON Prague 2014
 
subject: Path for Servlets