aspose file tools
The moose likes Servlets and the fly likes What if browser request url matches two Url patterns defined in two differnet <servlet mappings> tag Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "What if browser request url matches two Url patterns defined in two differnet <servlet mappings> tag" Watch "What if browser request url matches two Url patterns defined in two differnet <servlet mappings> tag" New topic
Author

What if browser request url matches two Url patterns defined in two differnet <servlet mappings> tag

Abhineet Kapil
Ranch Hand

Joined: Feb 08, 2010
Posts: 42

Hi

In web.xml


Now the request that comes from browser is >> Http://localhost:8080/MyConfusedApp/test

In such case please tell which servlet will be invoked as the request matches both the url patterns....
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6603
    
    1

The URL does not match either pattern


SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
kamal preet
Greenhorn

Joined: Sep 11, 2006
Posts: 3
I have taken two servlets with the same url pattern :




And I hit below url on the browser :

http://localhost:8080/ServletTest/test1


In such a scenario when the requested url exactly matches 2 or more url patterns, Container traverses through the web.xml and invokes the last matching servlet.


So in the above case servlet Test1 gets invoked..

Abhineet Kapil
Ranch Hand

Joined: Feb 08, 2010
Posts: 42

Thanks KP
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: What if browser request url matches two Url patterns defined in two differnet <servlet mappings> tag
 
Similar Threads
my servlet says its unavailable in IE
Confirmation Required(About Filter Sequence)
Giving same name for URL pattern in web.xml
order of filter mapping
servlet-mapping