0

After performing some validation in a Sling Servlet, I want to redirect to a 'Thank you' page, but it is not working — I can't access the request object.

We are doing it this way:

RequestDispatcher dispatcher = slingRequest.getRequestDispatcher("/content/project/abc/us/en/homepage.html", options);
dispatcher.forward(wrappedRequest, slingResponse);

We also cannot get the request object in the next page if we use sendRedirect() instead.

anotherdave
  • 6,656
  • 4
  • 34
  • 65
OmP
  • 189
  • 1
  • 3
  • 21
  • 2
    Please define "not working". Do you get an error message? Can you show the stack trace? – David Levesque Aug 28 '14 at 20:27
  • It means when I'm trying to get the request parameters in the redirected page(homepage.html), I cannot get the parameters. – OmP Aug 29 '14 at 05:31
  • @OmP In the question you've said you can't get the `request`, but in the comment above, you mention that you can't get the parameters — could you clarify which one it is? Also, as per David's comment, if you could give the error message that you're seeing too. – anotherdave Aug 29 '14 at 08:13
  • Why not set the value you want to redirect in a request or session scope? and use it in the thank you page, alternatively you may also set the parameter value in crx i.e. jcr and simply redirect to thank you page there you may access the value from crx. – yash ahuja Nov 24 '14 at 06:45
  • This is fixed now. Thanks guys. We used sessionStorage/localStorage for this. – OmP Nov 24 '14 at 10:49

1 Answers1

0

This is fixed now. Thanks guys. We used sessionStorage/localStorage for this.

OmP
  • 189
  • 1
  • 3
  • 21