Grails 404 UrlMapping的问题 [英] Problems with Grails 404 UrlMapping

查看:102
本文介绍了Grails 404 UrlMapping的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题让Grails将我的404错误映射到文档中的错误控制器。我正在运行Grails 1.3.5,并将以下映射添加到默认应用程序中:

404(controller:'errors',action:'notFound' )

它适用于映射500个错误,但不适用于404。我似乎记得之前有过这个问题,它与Tomcat(vs Jetty)有关,但我不记得有修复或我认为现在可能已经解决。 尝试访问未定义的资源,如 http :// localhost:8080 / appName / controllerName / blah ,我得到的只是默认的Tomcat 404.



我正在做一个标准的

解决方案

在删除空格后,问题得以解决
$ b


<404>(controller:'errors',action:'notFound')


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

"404"(controller:'errors', action:'notFound')

这篇关于Grails 404 UrlMapping的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆