![]()
By default if you create a Grails application called funkysite (i.e. you did grails create-app funkysite on the command line), then when you run your application the root context is set to /funkysite. This means that your controllers such as a UserController with a show action will be available at http://localhost:8080/funkysite/user/show. Having “funkysite” as the root context is redundant, especially if you want to host your application at http://funkysite.com/funkysite/user/show.
My preference is to just have “/” as the root application context. Fortunately, you can easily configure the root application context in Grails. All you need to do is edit conf/Config.groovy and add grails.app.context = “/”. This will set your root application context to “/”, so that the above UserController and show action will be available at http://localhost:8080/user/show.

Nice tip! What do you do when you go to deploy a WAR file then? Does it work the same way or do you have to configure something on the app server?
Thanks for the tip, Being a non grails application expert, i could do the job of grails expert with the help of your tip.
Thank you, thank you, thank you.
Great! Very helpful,thaks
Finally I found how to do this. Thank you!
“What do you do when you go to deploy a WAR file then? Does it work the same way or do you have to configure something on the app server?”
At least for Jetty and Tomcat you just deploy your war with the magic name ROOT.war instead of e.g. funkysite.war
Great! None of my Grails books lost a word on this topic. Thanks a lot!
Regards
Sik tip brub. big up to the OG tripple OG!
Sik tip bruv. big up to the OG tripple OG!
Thanks – worked perfect for me.
Great! Thanks
Thank you.
Pingback: grails 2.0 – correct use of serverURL for production? | PHP Developer Resource