在 grails 中创建 URL 的标准方法是:
<a href="${createLink(controller:'news', action: 'show', params: [id: news.id])}">${news.title}</a>
生成网址:/news/show/102
我想要更多 SEO 友好的 URL,例如:
/news/102/this-is-the-hottest-news-today
在 Grails 中最干净的方法是什么?我可以使用 grails URLMapping 映射/news/show/102
到/news/102
,但我如何创建像上面这样的完整 URL?