Forums Register Login

servlet tags declared before servlet-mapping

+Pie Number of slices to send: Send
Hi,
I was reading the Invoker Servlet FAQ and it says that:

...
The Middling Tale
...
Order of elements in web.xml is very important. So when you go to create your second 'couplet', make sure all your <servlet> tags are declared before your <servlet-mapping> tags. You'll maybe want to keep the 'couplets' together, because it will be easier to see which one belongs to which, but don't do it!


I've been writing the <servlet-mapping> tag just after its own <servlet> tag and I haven't had problems.
Does any one knows why don't keep 'couplets' together?
[ August 31, 2008: Message edited by: Angel J Gama ]
+Pie Number of slices to send: Send
What version of servlets are you using? The order was relaxed for 2.4 which uses XML Schema rather than a DTD.
+Pie Number of slices to send: Send
I'm using servlet spec 2.5 (tomcat 6.x)...

would it be a good "practice/convention" to code <servlet> tags first, and then <servlet-mapping> tags?
Thanks
+Pie Number of slices to send: Send
In practice it is easier to manage by coupling the servlet and servlet-mappings, as it is easier to manage if you end up with a large number of servlets ie it scales better.
It's a tiny ad only because the water is so cold.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 801 times.
Similar Threads
Cant read config params in JSP
Order of elements in DD and servlet/servlet-mapping
RequestDispatcher problem
url-pattern example
access a servlet usin its name
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:32:57.