根据Url Mapping的优先级可以如下设置
比如要实现产品详细页面的伪静态化,产品原路径:product/show?id=1
"/product/$action/${id}.html"(controller:"product"){
}
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
配置上以上两个后详细路径将会自动匹配为 product/show/1.html
详细可参考grails的帮助文档http://grails.org/doc/latest/guide/theWebLayer.html#urlmappings。
本文介绍如何使用Grails框架中的URL映射功能实现产品详细页面的伪静态化。通过配置特定的规则,将动态路径转化为静态文件的形式,提高用户体验及搜索引擎友好度。
455

被折叠的 条评论
为什么被折叠?



