I'm currently doing my Grails 301 URL-redirects using the following quite cumbersome "servlet style" method:
def action = {
...
if (shouldRedirect) {
response.status = 301
response.setHeader("Location", "http://url/to/redirect/to.html")
render("")
return false
}
...
}
Is there any cleaner and more compact Groovy/Grails'y way to perform a 301 redirect?
Please note that I'm talking about 301 redirect, not the standard 302 redirects which can be achieved using the standard Grails redirect(...)
mechanism.