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

  • SEARCH
  • Home
  • 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 9099587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:39:16+00:00 2026-06-17T00:39:16+00:00

Have such problem: when use spring security 3, try to ask resource (via GET)

  • 0

Have such problem: when use spring security 3, try to ask resource (via GET) or commit form (via POST) while should log in. So I redirected to log in form and then spring recover my original request, but it always recovered as GET request (even if I try to make POST request). So I wonder how can I fix it? Or may be how can I allow spring security to store only GET request and skip POST?

I found such code in DefaultSavedRequest:

public boolean doesRequestMatch(HttpServletRequest request, PortResolver portResolver) {

    ...

    if (!"GET".equals(request.getMethod()) && "GET".equals(method)) {
        // A save GET should not match an incoming non-GET method
        return false;
    }

So as I understand, this method compare cache request and incoming request and it shows that requests are not equals only if incoming request is not GET and storing request is GET. So in my case Storing request is POST and incoming is GET, so it return that the are equals, so it work wrong. What can I do with it? Is it bug or there some sense in such specific compare?

UPDATE.
I rerun error and see that my primary description was not full. I try to describe it more detailed. I have GET url, that opens form and it commits on the same URL via AJAX as POST with popup message window. I perform GET URL, form opens. Than I logout, and try to commit form. Popup window output error. I log in and redirected to URL (that are the same for GET/POST request), but on screen see not form, but JSON response of my AJAX request and in Firebug I see that after log in performs POST request. When I delete cache filter after login I redirected to the same URL, but it works not as POST request, but as usual GET request and opens form.

  • 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-06-17T00:39:18+00:00Added an answer on June 17, 2026 at 12:39 am

    As the manual says, saved-request handling is a “best effort” approach. It can’t be all things to all people. It will cache a request (no matter what the request method, GET, POST etc) while it performs a login, and then redirect to the cached URL after login.

    The incoming request after the redirect will be a GET (you can’t redirect to a POST, for example), so it will do its best to match this against the cached request and decide whether the cached request should be used to replace it, thus carrying on as if the login had never happened.

    The code you have posted refers to the case where the user tried to make a GET request and was then prompted to login. If a subsequent request to the same URL is not a GET, it is not the result of the post-login redirect, so the cached request should not be used to replace it.

    You can customize the RequestCache using the request-cache namespace element, or replace it with a no-op implementation. If you don’t want to use cached requests, you can set the always-use-default-target property of your form-login configuration.

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

Sidebar

Related Questions

So, i have such problem: first time, then the <a> get clicked e.preventDefault() isn't
I have some problems with authorization. I don't want to use Spring Security, just
I have a java web application that use spring security for log in users,
I have such problem: I'm using rails, devise gem and jQuery validation plugin. I
I have such a basic problem in Delphi,I can't solve it. My Code: Note:DataR
I have a problem such that i have zip files uploaded from forms and
I have some problem whith such mysql_query INSERT INTO table VALUES ('', CURDATE()-1) why
I have some complicated, problem to be solved. Now I need to write such
I am trying to use PreAuthFilter (for Siteminder) with Spring Security 3.0. <http use-expressions=true>
I can have Spring convert my json POST submission into an object with a

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.