`
agile_boy
  • 浏览: 550067 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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. }  
分享到:
评论
2 楼 agile_boy 2008-04-21  
你用的是grails1.0.2吧?我还没有测试过。如果有什么疑问,可以到maillist去问,或者去http://www.chinagroovy.org/forum提问 
1 楼 mickeyccq 2008-04-21  
用的0.7.1,使用之后还是不行。。

相关推荐

Global site tag (gtag.js) - Google Analytics