• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About the serlvet specification

 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SRV.11.1
On pt 2, it says that the "... the longest math determines the serlvet selected", what is that means? does it relate to anything in the Deployment descriptor??
also, on SRV.11.2.2
it says if incoming path is "/foo/bar/index.html "... servlet handling request would be "servlet1".... does it mean servlet1 will be run when user request "http://xxxx/foo/bar/index.html"... and if index.html does exist in the system? will index.html be returned?? I am confused, please help.
 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any one?
 
sridhar satuloori
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All these mappings you define in deployment descriptor under the element
<servlet-mapping>
<servlet-name></servlet-name>
<url-pattern> /foo/bar/* </url-pattern> <-- pattern checking against url
</servlet-mapping>
1)no its not relative anything in DD. In this Container compares the URL against the url-pattern starting from the "/" and the longest path matching decides the servlet to use
2) if /foo/bar/* mapped to Servlet1 then any url of the form http://mysrever/foor/bar/ANYTHINGHERE will be mapped to Servlet1. even if a physical file "ANYTHINGHERE" presents in that path. Servlet1 may use this for its further processing.
Sridhar
 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx alot for ur reply!
finally got my question answered!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic