jeudi 18 juin 2015

servlet mapping to last path segment

I am trying to map a servlet to a specific url in web.xml. The problem is that there is a dynamic path segment in the url and I need to map my servlet only to URLs ending with a specific path. For given URLs:

http://ift.tt/1Cgpmus
http://ift.tt/1flRrvo
http://ift.tt/1CgpkCP

I need to map a servlet like:

<filter id="EndFilter">
    <filter-name>EndFilter</filter-name>
    <filter-class>com.company.EndFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>EndFilter</filter-name>
    <url-pattern>*/end</url-pattern> 
</filter-mapping>

I know that */ is not a valid wildcard but I dont know if this type of mapping is even possible. It is easy to map URLs with resources like pictures with endings *.png or *.jpeg wildcard but i can't find a way to map a simple url path segment.

Aucun commentaire:

Enregistrer un commentaire