File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Greenhorn

Joined: Feb 08, 2010
Posts: 21

Hi

In web.xml

<servlet>
<servlet-name>One<<servlet-name>
<servlet-class>com.test.Test1<servlet-class>
<servlet>

<servlet>
<servlet-name>Two<<servlet-name>
<servlet-class>com.test.Test2<servlet-class>
<servlet>

<servlet-mappings>
<servlet-name>One<<servlet-name>
<servlet-class>*.do<servlet-class>
<servlet-mappings>

<servlet-mappings>
<servlet-name>Two<<servlet-name>
<servlet-class>*.xyz<servlet-class>
<servlet-mappings>


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: 6371

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
 
jQuery in Action, 2nd edition
 
subject: What if browser request url matches two Url patterns defined in two differnet <servlet mappings> tag
 
Threads others viewed
my servlet says its unavailable in IE
Confirmation Required(About Filter Sequence)
servlet-mapping
order of filter mapping
Giving same name for URL pattern in web.xml
developer file tools