我有一个Grails 2.0 webapp,当我尝试去一个url,例如 http://localhost:8080/ $ {myapp}/controller/action它总是重定向到http://localhost:8080/controller/action,没有我的webapp名字。 这是我UrlMappings.groovyGrails url重定向问题
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
任何建议,为什么会重定向到错误的URL?
感谢您的时间
你设置'grails.app.context = “/ APPNAME”'在你的'Config.groovy'中? – 2012-02-10 15:17:08
感谢您的回复,我会在星期一尝试,我不在办公室 – 2012-02-10 16:08:23