grails 0.5 xfire插件不能工作原因
grails0.5发布以来,grails-xfire的WebService插件也紧跟发布,实在是好消息,可是当你兴致勃勃的去写个HelloWorld的时候,它却给你一个下马威,异常如下:
HTTP ERROR: 404 Not Found RequestURI=/mytest/services/test Powered by Jetty://查看mailing list好像不只我一人遇到,好像还没有解,于是根据反馈的提示,可能是URL mapping出了问题,发现在URL mapping的文档中有解,如下:
IgnoringURLs
Sometimes you may want to resolve URLs to servlets other than Grails. In this case, note that Grails ignores any URLs that fail to match at least one of the patterns in the mapping. So, having:
static mappings = { "/grails/$controller/$action?/$id?"{ ... } }
would ensure that you could, for example, use /remoting/* for a Spring invoker servlet. Beware, though, that the pattern in the default mapping captures a large range of useful URLs.
呵呵,原来官方文档已经早有解决方案,是我太固陋寡闻,借此给碰到此类问题,又不知如何解决同类中人以一些解释不过还是有个问题,就是这样修改会影响原来正常的grail的controller/action操作,目前还不知道有何好解?
我目前所知道的方法就是将每个controller映射写死在grails-app/conf/*UrlMappings.groovy中,比较笨重,但能解决问题
--补充一个比较好的解决方案:在grails-app/conf/*UrlMappings.groovy中修改mappings,如下static mappings = { "/$controller/$action?/$id?"{ constraints { controller(matches:/.*[^(services)].*/) } } }
相关推荐
hooopo 2014-07-12
80447518 2014-06-18
purpen 2014-05-23
jackyzhuyuanlu 2015-02-12
龙浩然 2015-11-06
daociyiyou 2016-11-07
coderbx 2013-03-11
yehell 2012-04-24
yeyedeyatou 2011-08-04
Ben的程序员生涯 2011-04-29
jieren 2010-02-18
carpenterworm 2009-04-03
trapeze 2008-06-06
掘井之路 2019-07-01