GrailsURL映射
下面我们用一个例子接收URL映射。学过web开发的人一定知道如图下图的错误界面
如果想更改错误界面我们只需在
grails-app/conf/UrlMappings.groovy文件中配置错误界面
—————————————————————————-
class UrlMappings {
??? static mappings = {
??????? “/$controller/$action?/$id?”{ constraints { // apply constraints here
??????????? } }
??????? “/”(view:”/index”)
??????? “500″(view:’/error’)
??????? “/toLogin”(controller:”admin”, action:”index”)
??????? “404″(view:”/errors/notFound”)
??????? “403″(view:”/index”)
??? }
}
——————————————————————————
效果如图