servlets - Get configured url patterns in a Java Filter -


this question has answer here:

i cannot find way url-mapping information inside 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 list of mappings ["/ws/","/rest/"]. there way it?

@override  public void init(filterconfig filterconfig){     filterconfig.getxxx() // -> ["/ws/*","/rest/*"]??? } 

filterconfig per filter , aware of filter. not sure of intention reading urls can read web.xml , search filter url patterns using file reading approaches


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -