Forums Register Login

servlet-mapping tag in web.xml

+Pie Number of slices to send: Send
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?


+Pie Number of slices to send: Send
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

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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'd appreciate it if you pronounced my name correctly. Pinhead, with a silent "H". Petite ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1017 times.
Similar Threads
Head First BeerSelect problems
JSP Not able to Identify the JS, CSS file path
beer app not running
whats wrong in my DD ?
The requested resource () is not available.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:44:06.