1 Reply Latest reply on Mar 16, 2005 9:12 AM by Scott Stark

    I have problem with Filters and j_security_check.

    Vitaly Newbie

      I have problem with Filters and j_security_check.

      I need to do some additional actions after authentication and I decided to use filter for j_security_check.

      Here my filter code:

      public class PostLoginFilter implements Filter {
      
       public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
      
       System.out.println(?Before j_security_check?);
       filterChain.doFilter(servletRequest, servletResponse);
       System.out.println(?After j_security_check?);
       // My code here
       ?.
       }
       ?
      }


      Web.xml

      <filter>
       <description>This filter is executed after login</description>
       <filter-name>PostLoginFilter</filter-name>
       <filter-class>PostLoginFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>PostLoginFilter</filter-name>
       <url-pattern>/j_security_check</url-pattern>
       </filter-mapping>
      


      Login page form:

      <form name="loginForm" method="get" action="j_security_check
      Username: <input type="text" name="j_username"/>
      <br/>
      Password: <input type="password" name="j_password">
      <br/>
      <input type="submit" name="btnSubmit" value="Sign In" />
      </form>


      But JBoss/Tomcat does not execute it.

      I use JBoss 4.0.1SP1.

      I also tried with Tomcat 5.5.7, the same problem.

      Is it Tomcat bug????
      Or Tomcat does not support filters on j_security_check???