how to differentiate grails url mappings -


i have mappings:

"/$controller/$action?/$id?"{             constraints {                 // apply constraints here             }         } // used scaffolding , think required generated stuff '/'(controller:'home') //for home page '/$param1?/$param2?'(controller:'search') //for search page  

the required url displayed in browser is:
www.site.com/ - home

www.site.com/keyword1/keyword2 - search these optional keywords

this seems work question is: can expect correct or in situation grails things mixed up?

it not. grails sort url mappings based on given set of precedence rules ( specific general ).

your urls same , return same page.

however, because mappings ambigous, might return page don't expect. better design have search mapped to:

/search/params1?/params2?

this way unambigous.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -