默认Grails'/'控制器映射无法正确解析

mbr*_*ort 9 grails groovy weblogic weblogic-10.x

这个一直让我疯狂.自从升级到Grails 1.2和Weblogic 10.3以来,"/"的默认根映射停止了工作.这是我的...

我有这个URL映射:

"/"(controller:"IGive", action:"index" )
Run Code Online (Sandbox Code Playgroud)

我有一个名为IGiveController的控制器,带有索引闭包

def index = {
    render "foo"
}
Run Code Online (Sandbox Code Playgroud)

当我使用http:// localhost:8080/mycontext /我在嵌入式Tomcat和Jetty中运行我的应用程序时,我得到了"foo"返回的属性.但是当我构建战争并部署到Weblogic 10.3时,我得到了404.

我降级到Grails 1.1.2并且它仍然无法在Weblogic 10.3上运行,但错误更具描述性

Could not open ServletContext resource [/WEB-INF/grails-app/views/index.gsp] 
Run Code Online (Sandbox Code Playgroud)

因此,它似乎完全忽略了我的URL映射"/",但其他更深层次的URL映射正在起作用.任何线索?

spi*_*die 8

我认为这与Weblogic更相关 - 我在Weblogic 9.2上看到的相同 - 但在Tomcat或Jetty上却看不到.没有点击我的UrlMapping:

"/"(controller: 'home', action: 'index')
Run Code Online (Sandbox Code Playgroud)

我认为Weblogic很聪明并转换/ - > index.gsp然后以404的形式返回.

有一个稍微丑陋的解决方法 - 只需添加这样的映射:

"/index.gsp"(controller: 'home', action: 'index')   
Run Code Online (Sandbox Code Playgroud)

而这似乎可以解决问题.谁有更好的方法来解决这个问题?