J_spring_security_check is not available. Please help with Spring3 login

I am trying to write something in Spring3 using Security. I tried to use the default login screen, which everyone says Spring will be displayed for you. but after two days of trying and getting an error:

/ spring -security-login not found

I passed and changed my code to:

<http auto-config="true"> <intercept-url pattern="/friends/**" access="ROLE_USER,ROLE_ADMIN" /> <form-login login-page="/login.jsp" default-target-url="/friends/add.html" authentication-failure-url="/login.jsp?authfailed=true" /> </http> 

and I added login.jsp to my project, which I think did the right thing. Now I get this error:

HTTP Status 404 - / MySpring / j_spring_security_check message / MySpring / j _spring_security_check description The requested resource (/ MySpring / j_spring_security_check) is not available.

+4
source share
1 answer

add this to your web.xml

 <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> 
0
source

Source: https://habr.com/ru/post/1345443/


All Articles