1. Create a TagLib file
grails-app\taglib\MyAppTagLib.groovy
2. Define a method that routes to your first page
class MyAppTagLib {
def redirectMainPage = {
response.sendRedirect("${request.contextPath}/myController/welcomePage/")
}
}
3. Change your index.gsp to contain only:
Note: One advantage to this approach is that you have a coding opportunity over simply mapping the "/" url.
For example, if you want to provide features or data based on a specific user's login id.
A collection of articles and resources of interest to the modern software developer
Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do.
-- Steve Jobs
Thursday, October 20, 2011
Redirecting from index.gsp | Groovy on Grails
Groovy on Grails: Redirecting from index.gsp
Labels:
Grails
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment