On June 21, 2016 at 2:16:53 AM, Saleh Mamdouh
(
salehmam...@gmail.com) wrote:
>
>
> Question : Can I map a URL to just a controller ?
> For example :
> "/test" (Controller:"hello”).
Yes, but you would use “controller” instead of “Controller”.
>
> By that mapping, I would assume that "/test/action1" would be automatically
> mapped to HelloController::action1 and "/test/action2" would automatically
> map to HelloController::action2.
No, the above mapping would map to the default action in
HelloController. If you want “/test/action1” to map to action1 and
“/test/action2” to map to action2 then you could do something like
this:
“/test/$action”(controller: ‘hello’)
>
> Another sub-question:
> Can I use parts of the URL to determine the action name.
> Ex: "/test/$var1" (Controller:"$var1_old") ?
>
I can’t tell what “$var1_old” is supposed to be there. The question
as written “Can i use parts of the URL to determine the action name”
is answered in my answer to the previous question.
JSB
--
Jeff Scott Brown
OCI Grails Practice Lead
Principal Software Engineer
Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/