grails 0.5 xfire插件不能工作原因

  grails 0.5发布以来, grails-xfire的WebService插件也紧跟发布,实在是好消息,可是当你兴致勃勃的去写个HelloWorld的时候,它却给你一个下马威,异常如下:
java 代码
 
  1. HTTP ERROR: 404  
  2.   
  3. Not Found  
  4.   
  5. RequestURI=/mytest/services/test  
  6.   
  7. Powered by Jetty://  
查看 mailing list好像不只我一人遇到,好像还没有解,于是根据反馈的提示,可能是 URL mapping出了问题,发现在URL mapping的文档中有解,如下:
Ignoring URLs

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,如下
java 代码
 
  1. static mappings = {  
  2.   "/$controller/$action?/$id?"{  
  3.       constraints {  
  4.                 controller(matches:/.*[^(services)].*/)  
  5.           }  
  6.   }  
  7. }  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值