Another question with urlmapping grails

ok, so I asked, and got an answer on how to create a single controller instance, case insensitive with respect to URLs. I can do

"/mycontroller/$action?/$id?"(controller: "myController")

so when the application outside tries to link to a link in our application, your lowercase urls (:( sigh) will work.

I need to expand this to include actions in it. So the question is, following the above approach, do I need to bind a URL for each action?

/mycontroller/methodone/(controller: "myController", action: methodOne)
/mycontroller/methodtwo/(controller: "myController", action: methodTwo)

Something like the above?

+3
source share
2 answers

This is similar to the question below which I answered and included the source code

How to make my mapping code insensitive?

+1
source

, ( ) :

"/mycontroller/$a?/$id?" {
    controller = 'myController'
    action = { params.a?.toLowerCase() }
}
0

Source: https://habr.com/ru/post/1754516/


All Articles