Is that how he worded the question? Was he asking if you can use the same url pattern for two different mappings?
Was he asking if you can map to different url patterns to the same servlet name?
Joined: Feb 22, 2006
I tried this in Tomcat5.028 server I get result Server doesnot throw any excetion. But result is unexpected. I hope i got first resource which has already used this name. But it displays different Can u answer this how it works?
Personally, I can't see the sense in asking such a question. Maybe you misunderstood him.
Section 10 of the servlet spec (link in my signature) covers url patterns.
It would make sense for him to ask you about multiple mappings pointing to the same resources. It would also make sense if he asked about the a given request matching two different mappings. Example if the request was: http://www.javaranch.com/myServlets and you had two mappings that matched this pattern
In this case, section 10 of the servlet spec clearly states which of the two mappings should be used. Now that I think of it, this must have been what he was asking. There is no logical reason for the servlet spec to give directions for handling two mappings with identical url-patterns. [ June 01, 2006: Message edited by: Ben Souther ]