--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/IiuQh_K7e7kJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Just include the original URL in the login call. This is a pretty common solution.
On Wed, Jul 11, 2012 at 1:16 PM, Alex Hanschke <alexander...@gmail.com> wrote:
What is the most elegant way to route back to the client's previous page?
I'm thinking of an application which has a login form on every page and, at some point the client is required to login.
I then want to make sure the login action routes back to the page the user was on.
Any ideas?
Cheers,
Alex
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/IiuQh_K7e7kJ.
To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
try{ redirect(request.headers.get("referer").values.get(0)); } catch (Exception e) { redirect("/"); }It should be difficult to port this for Play 2
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/xX-VlDFpsOIJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
[I am learning play so I have not tried this.]
I know I should just embrace the web, but I believe that loading up the url with query strings is an ugly failure to separate concerns. So the way I have handled this in other frameworks is to embed the original target (or referrer, or whatever the semantic destination should be) as a hidden field in the login form. Then, when the user hits submit, my POST action reads the hidden field and does a redirect...assuming successful validation of course.
HTH,
Carlos
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/IiuQh_K7e7kJ.