Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7537039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:44:22+00:00 2026-05-30T06:44:22+00:00

I am using Spring security 3.0.6 . The following JSP snippet is the culprit

  • 0

I am using Spring security 3.0.6. The following JSP snippet is the culprit :

<sec:authorize access="hasRole('ROLE_PREVIOUS_ADMINISTRATOR')">
                         <a href="<s:url value='/exitUser' />">
                            Switch back to your own role</a>
</sec:authorize>

The following exception is thrown :

    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)

I have successfully switched the user to another role and is now trying to display the link to switch back to his own role, but only if he has actually switched. I gather that the user has ROLE_PREVIOUS_ADMINISTRATOR if he has switched roles, and so I am doing the above.

I have included the tag library via :

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:44:23+00:00Added an answer on May 30, 2026 at 6:44 am

    I had not specified

    <http use-expressions="true">
    

    in my spring security xml. After having done that, and changing the intercept urls to use expressions in their accepts values, the error disappeared. Wasn’t able to reproduce the error in a simple test application though.

    Edit : Another instance where I found this error was when I was using a custom SPEL expression in the authorize tag, and there was a NullPointerException in the method which handled the expression.

    Basically, it seems that the this error usually hides an underlying error in evaluating the expression used in the authorize (or any) tag

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When using spring security, specifically with @notation; what is the proper way to access
I'm using Spring Security 3 and my ApplicationContext-Security.xml specifies <form-login login-page=/genesis default-target-url=/diagnostics/start-diagnostics authentication-failure-url=/genesis?authfailed=true authentication-success-handler-ref=customTargetUrlResolver/>
I'm using Spring Security 3.0.7 How can I get with java code the access
I am using spring, spring security, hibernate. Got a jsp page where i am
I'm using Spring Security in Grails to restrict access to my controllers. I have
I am using the spring core security plugin and try to invoke the <sec:ifAnyGranted
I ran into the following problem using spring-security 3.0.3 with jersey 1.2: when i
I am running NTLM using Spring Security, I am getting the following error org.springframework.beans.factory.NoSuchBeanDefinitionException:
I have the following situation: my application's authorization mechanism is implemented using Spring security.
I would like to configure spring MVC application using Spring security the following way.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.