I cannot find a way to get the url-mapping information inside a filter.
For instance, web.xml:
<filter>
<filter-name>someFilter</filter-name>
<filter-class>com.xxx.filter.SomeFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>someFilter</filter-name>
<url-pattern>/ws/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>someFilter</filter-name>
<url-pattern>/rest/*</url-pattern>
</filter-mapping>
Then inside SomeFilter I would like to get a list of the mappings ["/ws/","/rest/"]. Is there a way to get it?
@Override
public void init(FilterConfig filterConfig){
filterConfig.getXXX() // -> ["/ws/*","/rest/*"]???
}
Filterconfig is per filter and is aware only of that filter. Not sure of the intention but for reading the URLs you can simply read the web.xml and search for filter URL patterns using file reading approaches