• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Mapping  RSS feed

 
Wilson Gordon
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For <servlet-mapping>, is it allowed to have more than one <url-pattern> inside the same servlet mapping?

For example:

<servlet-mapping>
<servlet-name>CaseManager</servlet-name>
<url-pattern>/cases/NewCase.do</url-pattern>
<url-pattern>/cases/EditCase.do</url-pattern>
<url-pattern>/cases/CaseManager.do</url-pattern>
</servlet-mapping>
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No it is not valid. You'll have to define a separate mapping for each url.
Or to redirect everything in "cases" to the CaseManager :
 
Wilson Gordon
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the very quick reply!

I have JSP in that cases folder too.

This should work for all those three URLs, right?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that you can mix mappings with file extensions and path.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!