web.xml
<filter>
<filter-name>SessionCheckFilter</filter-name>
<filter-class>filter.SessionCheckFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SessionCheckFilter</filter-name>
<url-pattern>/faces/app/admin/*</url-pattern>
</filter-mapping>
I'm trying to exclude the /faces/app/admin/index.xhtml
only, is there any way to do this?
If there's no exclude a url patterin in web.xml, maybe I can manipulate the doFilter()
method to exclude the url?
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse,
FilterChain filterChain) throws IOException,
ServletException {
HttpServletRequest request=(HttpServletRequest)servletRequest;
String path = request.getPathInfo();
if ((path != null) && (!path.equals("your path")){
// write filter logic
}
}
Try above code.