Announcement Announcement Module
Collapse
No announcement yet.
propogate request params through login page? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • propogate request params through login page?

    My application needs to allow anonymous users to fill out a form, but require them to log in when they submit the form. (The form target is the protected resource.) The original form request params are lost since it is a different request after login form submit.

    I thought I could use a dynamic list of hidden fields on the form page to resubmit the form values, but the request params are gone by the time it hits the login page. *poof* (And even if I could do that, I dont think that is the best way.)

    Any ideas?


    Thank you,
    Dan

  • #2
    Passing Form Values Through Login

    I too am interested in a solution for this problem. I am submitting a *session* scoped Struts DynaActionForm to a protected area which then requires authentication. After submitting the login form, the value contained by the Struts form is blank.

    Any tips would be greatly apprecitated. Thanks!

    Comment


    • #3
      Does the same thing happen if you use a GET request to submit the (initial) form, rather than POST (assuming that's feasible)?

      The current implementation doesn't translate POST parameters into a URL query string when it is redirecting to the original target after a successful login.

      Luke.

      Comment


      • #4
        Thank you for a reply Luke.

        I tried with GET and that does correctly pass the parameters around. For all my current use cases, GET will work technically, but I regret changing my beautiful, clean url structure to a long confusing one passing those parameters around. (A marketing "requirement" for our site is short clean URLs, and this would have to use GET form submissions through most of the site. :-/ )

        It also requires changes to controllers that extend the Spring SimpleFormController, etc that use the GET vs POST distinction for processing pages.

        Would the eventual solution be to internally translate from POST -> GET params? That doesnt seem like the best solution. I was thinking that I could printout the POST params into hidden fields on the login form and resubmit as a POST, but surprisingly to me the login page itself has already lost the POST params (not just the forwarded to page).

        Thanks again for any thoughts and suggestions. I'll hapily contribute some code to the project if the minds that be have a suggested patch.

        Comment


        • #5
          Thank you, Luke!

          Luke, converting from POST to GET did the trick. After looking at the thing so many times, I couldn't see the forest for the trees. Thanks for your help.

          Comment

          Working...
          X