No mapping found for HTTP request with URI [/pms/j_spring_security_check] in DispatcherServlet with name 'appServlet'

后端 未结 3 794
甜味超标
甜味超标 2021-02-06 05:37

I have developed a Spring application and I implement Spring security integration to Login and Logout function in it. I used Spring security with xml configuration. But when I l

相关标签:
3条回答
  • 2021-02-06 05:58

    Try changing your servlet mappings in your web xml to this:

    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
    
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    
    0 讨论(0)
  • 2021-02-06 05:59

    Below code solved my problem for annotation based security configuration. http.formLogin().loginProcessingUrl("/j_spring_security_check")...other settings

    0 讨论(0)
  • 2021-02-06 06:18

    I finally solved this by modifying the line where I was declaring my custom login form page.

    Added processing-url="/j_spring_security_check":

    <form-login login-page="/login" default-target-url="/admin" login-processing-url="/j_spring_security_check" authentication-failure-url="/login?error" username-parameter="username" password-parameter="password"/>
    

    to my security-context.xml page

    0 讨论(0)
提交回复
热议问题