I have a controller that needs to return a 404 page and status code on certain conditions. I can\'t seem to find out how to do this in Grails. A coworker recommended this me
response.sendError(404) will work with Grails UrlMappings whereas response.status = 404 does not for some reason. This is useful if you want to render a custom 404 error page, as opposed to just sending 404 back to the browser.