Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

jsp servlet mapping in web.xml (Tomcat 5.5)

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a quesiton about URL mapping in Tomcat 5.5.

If I have a definition in web.xml link this:

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.asp</url-pattern>
</servlet-mapping>

Which file does Tomcat really get to run? This is the URL:

http://localhost/mywebapp/login.asp

(Supposed I have two files, login.asp and login.jsp, in the root folder.)

Thanks.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP mapping in web.xml is not Tomcat specific.
It's spec driven.
Moving to the JSP forum.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The servlet mapping tells the server which handler (servlet) to use for which files (the url pattern)
The config lines you have there are telling the server that for any request matching "*.asp" should be handled by the servlet called "jsp"

If you look in the [TOMCAT_HOME]/conf/web.xml file, you will find both the servlet handler defined.
Tomcat will run the file login.asp, using the servlet "jsp".
Presumably that tells it to interpret the file login.asp as a jsp.
 
Jason Liao
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it. Thanks.
 
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic