如何在春季安全中注销
Posted
技术标签:
【中文标题】如何在春季安全中注销【英文标题】:how to do logout in spring security 【发布时间】:2012-02-03 20:36:07 【问题描述】:点击 jsp 中的注销链接时出现错误。我正在使用 Spring Security。
例外是:
Jan 6, 2012 9:30:45 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [appServlet] in context with path [/billingEngine] threw exception
java.lang.NullPointerException
at java.util.Hashtable.get(Unknown Source)
at org.apache.tomcat.util.http.Parameters.getParameterValues(Parameters.java:116)
at org.apache.tomcat.util.http.Parameters.getParameter(Parameters.java:127)
at org.apache.catalina.connector.Request.getParameter(Request.java:1133)
at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:384)
at javax.servlet.ServletRequestWrapper.getParameter(ServletRequestWrapper.java:140)
at org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler.determineTargetUrl(AbstractAuthenticationTargetUrlRequestHandler.java:86)
at org.springframework.security.web.authentication.AbstractAuthenticationTargetUrlRequestHandler.handle(AbstractAuthenticationTargetUrlRequestHandler.java:67)
at org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler.onLogoutSuccess(SimpleUrlLogoutSuccessHandler.java:28)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:100)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381)
spring security .xml 文件是
<http auto-config="false" entry-point-ref="authenticationEntryPoint"
use-expressions="true">
<custom-filter ref="authenticationFilter" position="FORM_LOGIN_FILTER" />
<intercept-url access="hasRole('ROLE_ADMIN')" pattern="/common/admin/**" />
<intercept-url pattern="/common/accounting/**" access="hasRole('ROLE_USER')" />
<intercept-url pattern="/common/billing/**" access="hasRole('ROLE_COMPANY')" />
<logout logout-success-url="/login"/>
</http>
如何解决?
谢谢
【问题讨论】:
你的问题和这个一样吗? ***.com/questions/7325655/… 【参考方案1】:它是bug SEC-1803,但在 Spring Security 3.0.7 中已修复。因此,如果您可以更新,请更新。
【讨论】:
以上是关于如何在春季安全中注销的主要内容,如果未能解决你的问题,请参考以下文章