Spring Security login after session expiration redirects to last JSF ajax request and displays its <partial-response> XML response like plain text

*爱你&永不变心* 提交于 2019-12-01 10:56:52

As Mr. BalusC said, Spring Security will redirect to last request after login. Because I used Poll so the it makes ajax request to the homepage after 10 seconds and when I login again, it will redirect to the ajax request.

So to solve this, I config in the security xml file as following, so that it will always redirect to the default page after login.

<form-login 
    login-page="/login.html"
    authentication-failure-url="/login.html?status=LOGIN_FAILURE"
    default-target-url="/index.html"
    always-use-default-target="true" />

Thank you so much, Mr. BalusC.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!