Accessing HttpServletRequest in Rythm template

6 views
Skip to first unread message

Harshdeep S Jawanda

unread,
Apr 18, 2014, 6:38:05 AM4/18/14
to Rythm Engine
I need to know the URL of the current page that is being generated. I will then use this in a Log In link on the page that, after logging-in, will redirect to the current page.

I can't find a way of doing this in the base (layout) template file.

Doing this in servlets (i.e., by setting params and passing them to Rythm engine) means having to do it all over the code.

--
Regards,
Harshdeep S Jawanda

green

unread,
Apr 19, 2014, 4:15:19 AM4/19/14
to Harshdeep S Jawanda, Rythm Engine
The login and redirect should usually be implemented at your controller layer, not the view. At least I did that for both Play!Framework project and SpringMVC project. 

There is no way for the template engine to know the current URL unless you pass it through to the template.


--
You received this message because you are subscribed to the Google Groups "rythmengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rythmengine...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages