• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Path for Servlets

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic