URL Mapping Issue



In a Grails web application (Grails Version 1.3.7 0 ), it is needed to implement URL Mapping to make some pages SEO friendly. For that we created a URL Mapping class.

There are two searches.
1. Doctor Page
2. Hospital page,

What we have done:

URL Mapping class as follows.

import grails.util.GrailsUtil
class UrlMappings {
static mappings = {
constraints {
// apply constraints here

name personList: "/$id?" {
controller = 'doctorProfileDetails'
action = 'doctorprofile'

name abc: "/$id?" {
controller = 'hospitalSearch'
action = 'hospitalProfile'

"/login/$action"(controller: login)
"/logout/$action"(controller: logout)


In the code it is being called from the respective pages as follows.
The value to be displayed is taken from DB Tables.


<g:link mapping="personList" params='[id:"{doctorInstance.slug}"]' title="{hospitalAddress}">{doctorInstance.doctorFirstName +" "+ doctorInstance.doctorLastName}
{(doctorInstance.education)? " - " + doctorInstance.education : ""}


<g:link mapping="abc" params='[id:"{hospitalInstance.slug}"]'>


What is happening is the second one (hospital search) is being mapped and the page is being displayed. But when the Doctor search is clicked, the page is broken with an error.

If the second one (Hospital Search) in the URL mapping class is commented, the doctor search will work.

Please advise to sort out this issue.