问题描述
我有一些问题让Grails将我的404错误映射到文档中的错误控制器。我正在运行Grails 1.3.5,并将以下映射添加到默认应用程序中:
404(controller:'errors',action:'notFound' )
它适用于映射500个错误,但不适用于404。我似乎记得之前有过这个问题,它与Tomcat(vs Jetty)有关,但我不记得有修复或我认为现在可能已经解决。 尝试访问未定义的资源,如,我得到的只是默认的Tomcat 404.
我正在做一个标准的
在删除空格后,问题得以解决
$ b
I'm having some problems getting Grails to map my 404 errors to an errors controller like in the documentation. I'm running Grails 1.3.5 and when I add the following mapping to a default application:
"404" (controller:'errors', action:'notFound')
It works for mapping 500 errors but not 404's. I seem to recall having this problem before and it being related to Tomcat (vs Jetty) but I don't remember a fix or I thought it might have been resolved by now.
I try accessing a resource that's not defined like http://localhost:8080/appName/controllerName/blah and all I get is the default Tomcat 404.
I'm doing a standard grails run-app for testing and trying to get it to work.
after deleting whitespace, the problem solved
这篇关于Grails 404 UrlMapping的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!