11

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?

kryger
  • 12,906
  • 8
  • 44
  • 65
galao
  • 1,281
  • 8
  • 26
  • 50
  • Another way : http://www.coderanch.com/t/169859/java-Web-Component-SCWCD/certification/Filter-Exclude-url-pattern – VKPRO Jul 16 '14 at 04:51

1 Answers1

0
      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.

Abhinay
  • 464
  • 5
  • 13