O'Reilly logo

Grails 2: A Quick-Start Guide by Ben Klein, Dave Klein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

User-Friendly URLs

We now need to provide a way to access our event page using a simple URL. The way it stands now, once the application is deployed, the URL to a specific event’s page looks something like this:

http://TekDays.com/tekEvent/show/5024753

(OK, the id might not be quite that large at first, but we’re thinking positive here.) Our customer would like us to get to something more like http://TekDays.com/events/MyTekEvent. This will make it easier for the event organizers and volunteers to plaster links all over the Internet for their event.

As we have come to expect, Grails provides a simple way to do this. Every Grails application has a UrlMappings class, which uses a DSL[73] to build URL mappings. The conventional Grails mappings ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required