Grails

Using TagLib to avoid changes due to change in URLMappings

Recently, I used Taglib to centralize the effect of URL mapping related changes of my grails application. [java] def userPageLink = {attrs, body -> def user = User.read(attrs.id) out << g.link(controller: ‘user’, action: ‘show’, params: [name: user.name]) {body()} } [/java] So wherever I need a link to user page, I can use this Taglib instead […]

Mohd Farid
Mohd Farid
Read

Grails

Grails: reverse url mapping to generate urls ending with “.html”

In this blog Reverse Url Mappings has been used to generate the URL ending with .html, given controller and action names.

Amit Jain
Amit Jain
Read

Grails

Restricting all URLs to end with .html in a Grails Application

While going through the grails-users mailing list, I found a question about restricting all URLs to end with ‘.html’ & returning Error 404 for the default mappings. After spending some time, I was able to build a sample CRUD application restricting URLs to end with .html. I did the following steps for the same: 1. […]