• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Mapping

 
sree visu
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt regarding the servlet mapping

consider three servlets with their URL pattern

ajax1 servlet *.view
ajax2 servlet /ajaxian/*
ajax3 servlet /myajax/yourajax/*.view

Also if the container is provided with

/ajaxian/javaranch.view

which servlet will be chosen whether ajax1 or ajax2 servlet

thanks in advance
 
Atul Samnerkar
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sree Visu,

For such questions remember the keyword EDiT (Exact, Directory, exTension) This is the sequence in which container will try to map the URL to the servlet.

With this EDiT rule, Directory has precedence over extension. Hence answer is ajax2 servlet /ajaxian/*. Hope this answers your query.

Thanks,
Atul Samnerkar
 
sree visu
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much Atul for your reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic