• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dbt in Directory Matching

 
Radmika Arunachalam
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
if you have servlet-mapping as below



if i call like this
http://localhost:80/MapTest/serve

will it call "myServlet"?
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think it is correct. It should invoke myServlet. Your mapping is type of path mapping. As the Path mapping is defined in web application, it will not search for welcome pages. It will always invoke the servlet.

Thanks
 
S.L.Narayanan
Ranch Hand
Posts: 431
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I think it wont invoke the servlet that u specified in DD. Reason is u have put http://localhost:80/MapTest/serve and not http://localhost:80/MapTest/serve/. You configured the DD to map to the URLs that are accessing anything inside the directory only. So in this case container will search for an exact match. If it is not there it will throw a 404.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Naryanan

Your quote
You configured the DD to map to the URLs that are accessing anything inside the directory only. So in this case container will search for an exact match.


When the container will search for exact match ? when the URL mapping is defined for exact match. Here in DD the mapping is defined for path mapping, and not for exact match. So it alway invoke myServlet.

If you are reffering Servlet Specs.(2.4), there are very good examples on page 87 how the incoming URLs are mapped to Servlets.

Hope it help you.

Thanks
 
Radmika Arunachalam
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks friends! Even i was thinking it will invoke only if '/' is there in the end.. now i am clear.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic