我有一個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