Announcement Announcement Module
Collapse
No announcement yet.
SavedRequestAwareWrapper: what is the point of this and how do I stop it Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SavedRequestAwareWrapper: what is the point of this and how do I stop it

    I am having problems with a simple login controller. If you try to log in with a few different user names the the value of the request parameter passed in for the @RequestParam is set to the concatenation of all previous values!
    So if I try username=foo and then in another request username=bar then my controller gets passed a value of "foo,bar"

    I debugged this back to SavedRequestAwareWrapper which apparently saves the values from previous requests and provides them as well as what was really passed in! I cannot comprehend what the point of this class is. I don't think I have done anything particularly strange in my spring security setup to deserve this!

    Please, how on earth do I disable the use of parameters from previous requests?

  • #2
    Ok, I think I figured out what is happening. The redirect-to-login logic of Spring Security really doesn't play nicely with REST or AJAX style apps.

    Disabling the request cache should hopefully fix it:

    ....
    <request-cache ref="nullRequestCache"/>
    </http>

    <beans:bean id="nullRequestCache" class="org.springframework.security.web.savedreque st.NullRequestCache"/>

    Comment


    • #3
      Incidentally, there are no source downloads available anywhere for spring security. The maven repo doesn't have them, the springsource.org download doesn't have them. I had to get the source from github.

      Comment


      • #4
        You can download the whole distro from http://static.springsource.org/sprin...downloads.html which includes binary and source jars, or get individual jars from Maven Central, e.g. http://repo1.maven.org/maven2/org/sp...3.1.1.RELEASE/

        Comment

        Working...
        X