aspose file tools*
The moose likes Servlets and the fly likes Multiple url-pattern in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Multiple url-pattern in servlet" Watch "Multiple url-pattern in servlet" New topic
Author

Multiple url-pattern in servlet

Pradeep Sahoo
Ranch Hand

Joined: Oct 13, 2002
Posts: 46
Can I associate multiple <url-pattern> with my deployed servlet.
If not is there any alternative.
Thanks in advance


Pradeep<br />Consultant - Enterprise Solutions,<br />Infosys Technologies Ltd,<br />Bangalore, India
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
you can make a number of different mappings to the same <servlet>.


Asher Tarnopolski
SCJP,SCWCD
Pradeep Sahoo
Ranch Hand

Joined: Oct 13, 2002
Posts: 46
Thanks Asher,
I would like to know how to configure the web.xml file for the same.
I tried giving multiple entries for <url-pattern> tag under the same servlet. But the descriptor could not be parsed by the Server.
Please help
Thanks once again
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
I would like to know how to configure the web.xml file for the same.
I tried giving multiple entries for <url-pattern> tag under the same servlet. But the descriptor could not be parsed by the Server.

Servers do seem to be picky about the order of elements. The real authority on web.xml is the servlet API - you can download it from java.sun.com as a pdf file. Alternate explanation would be that your web.xml file is ill-formed.
Bill
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

This is how I and Netbeans do it;
 
jQuery in Action, 2nd edition
 
subject: Multiple url-pattern in servlet