How can I return a 404/50x status code from a Grails Controller?

前端 未结 4 1701
傲寒
傲寒 2020-12-14 14:11

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

4条回答
  •  渐次进展
    2020-12-14 14:50

    response.sendError and response.setStatus are the only two ways I know of. If you static import HttpServletResponse, then it's not that 'un-grails-like'.

提交回复
热议问题