0
我正在使用Spring安全性3.0.6。下面的JSP片段是罪魁禍首:Spring安全性:sec:授權標記給出流關閉異常
<sec:authorize access="hasRole('ROLE_PREVIOUS_ADMINISTRATOR')">
<a href="<s:url value='/exitUser' />">
Switch back to your own role</a>
</sec:authorize>
下拋出異常:
Struts has detected an unhandled exception:
# Messages: Stream closed
File: org/apache/jasper/runtime/JspWriterImpl.java
Line number: 210
Stacktraces
java.io.IOException: Stream closed
org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:210)
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115)
org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:177)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:915)
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:652)
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:123)
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)
我已成功切換用戶到另一個角色,現在正試圖顯示切換回鏈路他自己的角色,但只有當他真的切換了。我收集用戶有ROLE_PREVIOUS_ADMINISTRATOR如果他已經轉換角色,所以我正在做上述。
我已經包括通過標籤庫:我沒有在我的春季安全XML指定
<http use-expressions="true">
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
必須有你沒有看到另一個潛在的錯誤隱藏的潛在錯誤。查看tomcat日誌以找到它。 – 2012-02-22 21:20:33