• Post Reply Bookmark Topic Watch Topic
  • New Topic

URL-Mapping / Filtermapping

 
Timo Munich
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

in Tomcat 7/Struts-Application I am using Filter to filter some Classes from others to do some validation on it.

I am trying to understand the url-mapping and I saw in an older Application the url-mapping:

When I use this syntax with the leading Slash "/" it does not work but instead, if I cancel the slash it seems to work, that means

What is the meaning of the leading Slash ? It is from an very old application and it seems, that it does not work on Tomcat 7.
My understanding of the "Slash" is about taking the web-context of this web-application, for example "myweb" in ${tomcat_home}/webapps/myweb

Thanks for help
 
Timo Munich
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the answer on my own post.

The URL-Pattern does not use the mod_rewrite and any regexpression-language. Furthermore the Wildcard * between characters does not mean what we usually would expect from a wildcard.
So the wildcard * in my example pattern

does not mean, that any request will match to a pattern that will end with -admin.do, for example:

instead


For people who are new in this theme please consider these four roules of the servlet-specification and keep in remind, that url-pattern does not support regexpressions.

  • A string beginning with a / character and ending with a /* suffix is used
    for path mapping
  • A string beginning with a *. prefix is used as an extension mapping.
  • A string beginning with a *. prefix is used as an extension mapping.
  • All other strings are used for exact matches only
  •  
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!