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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access