security - IP Filtering in Tomcat 6 -


i know filter using ip in tomcat 6,i have use bleow code valve classname=”org.apache.catalina.valves.remoteaddrvalve” allow=”10.10.1[12]..*”/>

this works me.but,how can restrict access specific servlet.the above blocks entire application,i want balock access specifi servlet.i tried below in web.xml,but display tomcat error page 404

<filter>       <filter-name>r</filter-name>       <filter-class>org.apache.catalina.valves.remoteaddrvalve</filter-class>       <init-param>         <param-name>allow</param-name>         <param-value>172\.16\.18\..*</param-value>       </init-param>     </filter>     <filter-mapping>       <filter-name>r</filter-name>       <url-pattern>*/json</url-pattern>     </filter-mapping> 

you can not use star(*) int start of url pattern.


Comments