• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

why ???

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a simple HelloWorld servlet in C:\tomcat\webapps\ROOT\WEB-INF\classes and html calling it in C:\tomcat\webapps\ROOT. why do i have to use ../servlet to call it in my form tag like this: <FORM METHOD="GET" ACTION="../servlet/HelloWorld"> when it's not in a servlet directory?
thanks for helping clear this up,
erik
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually you could also call it by typing www.yourdomain.com/servlet/HelloWorld. You have to type /servlet because TOMCAT is set up to know that by including this you are requesting a servlet. TOMCAT has also mapped a call to /servlet to the webapps/ROOT directory in TOMCAT.
You can actually go in and specify your own mappings if you want, but it's easier to accept the default whil you are learning.
Jason
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The directory Web-inf/classes is mapped to servlet by default.
 
erik weibust
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why does tomcat care if the request is for a servlet? and isn't it obvious becasue if the requestor wanted a jsp his request would end in *.jsp???
 
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Not necessarily, you could have tomcat map any extension to a JSP if you wanted to. Tomcat only treats .jsp files as JSP cause that is what it is told to do by default. If you wanted to you could map .crap (or .asp) files to be compiled as JSPs.
 
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic