jsf - 404 error after calling j_security_check -
the weirdest thing happening in web application. here <security-constraint>
section of web.xml:
<security-constraint> <web-resource-collection> <web-resource-name>non-secure resources</web-resource-name> <url-pattern>/js/*</url-pattern> <url-pattern>/theme/*</url-pattern> <url-pattern>/login.jsp</url-pattern> <url-pattern>/logout.faces</url-pattern> <http-method>get</http-method> </web-resource-collection> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>secure resources</web-resource-name> <url-pattern>/faces/*</url-pattern> <url-pattern>/fragments/*</url-pattern> <url-pattern>/pages/*</url-pattern> <url-pattern>*.faces</url-pattern> <url-pattern>*.jsp</url-pattern> <http-method>get</http-method> <http-method>post</http-method> </web-resource-collection> <auth-constraint> <role-name>allauthenticated</role-name> </auth-constraint> <user-data-constraint> <transport-guarantee>none</transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <auth-method>form</auth-method> <realm-name>map</realm-name> <form-login-config> <form-login-page>/login.jsp</form-login-page> <form-error-page>/loginerror.jsp</form-error-page> </form-login-config> </login-config> <security-role> <role-name>allauthenticated</role-name> </security-role>
when user accesses the application through http://<host-name>/<context-path>/
, user forwarded login page , after successful login fine. if user accesses application through http://<host-name>/<context-path>/login.jsp
, after successful log in, user gets 404 error message , url in browser http://<host-name>/<context-path>/j_security_check
.
anybody knows why happening , how can prevent it?
you have add these lines web.xml :
<filter> <filter-name>springsecurityfilterchain</filter-name> <filter-class>org.springframework.web.filter.delegatingfilterproxy</filter-class> </filter> <filter-mapping> <filter-name>springsecurityfilterchain</filter-name> <url-pattern>/*</url-pattern> <dispatcher>request</dispatcher> <dispatcher>forward</dispatcher>
Comments
Post a Comment