简体   繁体   中英

j_security_check filter is not working in jboss eap 6.4

I searched fıor a solution on internet and could not find anything.

My Issue is about using j_security_check on my login.jsp to filter and forward it to postloginfilter.java.

To do so I have wrote these lines in web.xml

<login-config>
  <auth-method>FORM</auth-method>
  <form-login-config>
    <form-login-page>/login.jsp</form-login-page>
    <form-error-page>/login.jsp</form-error-page>
  </form-login-config>
</login-config>

<filter-mapping>
  <filter-name>PostLoginFilter</filter-name>
  <url-pattern>/j_security_check</url-pattern>
</filter-mapping>

But even though when I call a forward like this :

final String requestStr = "/j_security_check?j_username=" + reqUserId 
+ "&j_password="+ reqPassword;

req.getRequestDispatcher(requestStr).forward(req, resp);

It is not coming into postloginfilter.java at all. and showing me an empty blank page.

What I want is going to postloginfilter doing the job and following the chain as listed on web.xml.

I also do not see if this filter works too.

  <filter-mapping>
   <filter-name>PostLoginFilter</filter-name>
   <url-pattern>/CreateConnectionAndGetEntityNames.do</url-pattern>
 </filter-mapping>

CreateConnectionAndGetEntityNames is actually the one which shows the form. But when I go there breakpoints are not taking effect in postloginfilter.

What might be the reason and how can I solve this issue?

thanks in advance.

As far as I know, the FormAuthenticator is implemented as a JBossWeb valve. As a result, it would be expected for JBoss j_security_check requests not to invoke any application servlet filter. You could implement such filters as valves instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM