This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet-mapping tag in web.xml

 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a question about the servlet mapping tag.

Does each <servlet-name>, <url-pattern> mapped pair have to be in it's own servlet-mapping root?

i.e., if I have this scenario:-


Can I write is as the following?


 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2167
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nidhi,

Good question: you can't.

Have a look at Servlet 2.4 spec (SRV.13.4 Deployment Descriptor Diagram)
You will find nice diagrams explaining all the elements of the DD

Regards,
Frits

 
Ram Narayan.M
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the latter form is the case, its tough to form the <servlet-name> and <url-pattern> pair since there is one parent <servlet-mapping> node... And when you write a XML parser for this, you will get list of <servlet-names> nodes and <url-pattern> nodes not knowing which forms which pair...

So, to ease up, the former standard is used.... In this case, you will get the list of <servlet-mapping> nodes which contains <servlet-name> and <url-pattern> pair and no confusion of mapping it... Thats why
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ram. So the parent <servlet-mapping> node is what ties the pair together. That's interesting.
Frits, the diagrams look quite helpful. Thanks for sharing.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic