【发布时间】:2012-02-10 13:34:28
【问题描述】:
我有一个 Grails 2.0 webapp,当我尝试访问一个 url 时,例如 http://localhost:8080/${myapp}/controller/action 它总是重定向到 http://localhost:8080/controller/action 而没有我的 webapp 的名称。 这是我的 UrlMappings.groovy
class UrlMappings {
static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/"(controller:"/admin")
"500"(view:'/error')
}
}
这是我的 application.properties
#Grails Metadata file
#Thu Feb 09 12:22:14 CET 2012
app.grails.version=2.0.0
app.name=appname
app.servlet.version=2.4
app.version=0.1
plugins.hibernate=2.0.0
plugins.tomcat=2.0.0
任何建议为什么它重定向到错误的网址?
感谢您的宝贵时间
【问题讨论】:
-
您是否在
Config.groovy中设置了grails.app.context="/appname"? -
谢谢你的回复,我周一试试,我不在办公室