Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to specific numerous url-patterns in web.xml  RSS feed

 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone show me the correct syntax to specific numerous url-patterns for a servlet in the deployement descriptor?

Thanks,
James
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far?
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying Bear,

I have it sorted now (couldn't find an example anywhere!)...

Needed to create a servlet-mapping element for each url pattern:

<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>*.rs</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/myServlet.*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/MyServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/myServlet</url-pattern>
</servlet-mapping>

Cheers,
James
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!