This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Groovy and the fly likes Re-directing to the correct page - Grails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Re-directing to the correct page - Grails" Watch "Re-directing to the correct page - Grails" New topic
Author

Re-directing to the correct page - Grails

Harjit Singh
Ranch Hand

Joined: Feb 01, 2007
Posts: 77
Hi there,

I have a gsp page which is associated with a controller class. The controller handles the login. When the login happens I re-direct it to a different view. When I hit the back button the login page appears again. How should I handle this

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

One way is have your action that is initially rendering your login page check to see if the user is already logged in, and if so, redirect appropriately.

On a side note params['login'] can be written as params.login. A bit less typing involved. ;)


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Re-directing to the correct page - Grails
 
Similar Threads
Passing objects across controllers in Grails
upload files to http post request
Actions behaving strangely
How to remove deafult layout from template
[Grails] Passing user object into hiddenField