• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple url-pattern in servlet

 
Pradeep Sahoo
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I associate multiple <url-pattern> with my deployed servlet.
If not is there any alternative.
Thanks in advance
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can make a number of different mappings to the same <servlet>.
 
Pradeep Sahoo
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how I and Netbeans do it;
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic