开发者

Persist url parameter throughout grails app

Essentially I am looking to have a url query parameter persist throughout the life of the grails application (POST or GET). ex.

http://localhost:8080/demo/controller/action/?myParam=foobar

I have tried a couple routes. Dynamic method overriding redirect and customizing application tags for createLink. However, since I also use grails webflows it doesn't quite get every single URL. I also tried using a gr开发者_Python百科oovy servlet (groovlet) to capture every URL and append the query parameter. The last attempt hasn't been very successful. Am I missing an obvious component to grails? Am I on the right track? Is there another avenue I haven't explored yet?

Thanks in advance


Have you tried using a filter? The following filter will add the param to every request

class MyFilters {
   def filters = {
       addParam(controller:'*', action:'*') {
           before = {
               params.myParam = 'foobar'
           }

} } }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜