This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 12761
    
    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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Path for Servlets
 
Similar Threads
servlet calling a JSP
Help on installing Tomcat
Displaying a .jsp page using Tomcat Server
MyPrj on http://localhost:8080/ ?
i cant run my program