I know I can specify a controller for root page using "/"(controller: "default") in UrlMappings.groovy, however I would like to make my main layout page (in that case is main.gsp) to access at least one defined controller. I’ve tried "/layouts/main.gsp"(controller: "default") but didn’t work. How can I accomplish it? Thanks!
I know I can specify a controller for root page using /(controller: default) in
Share
I found another way to fix my issue. Now I can pass user instance that is comming from session for every action. So every time and everywhere my layout header shows the user information (if user is logged on, of course).
My steps:
Modify your “after” clousure from the filter created
to get current user and pass it through to every controller’s action, it suppose to be something like that:
I hope it can be helpful, thanks!