grails - pass data from controller to filter -


In a Grails application I'm looking for some way to pass data for a filter from a controller action Moves after. I was thinking like something:

  class MyController {def myAction = {render (view: "myView", model: [key: "value"]) passData {// name = " Paolo "age = 38}}} public category MyFile {def name def age def filters = {myFilter (Controller:" * ", verb:" * ") {after = {model -> // something with name and age true}}}}  

The original plan was to do the following in closing the init () of bootstrap.config:

  • Use Meta-programming to add a "PassData (Closure PDC)" method for all controllers
  • Set the representative of the PDclosure for MyFilters, so that when the properties of the name and age of this Set to be turned off, they are set to the MyFilters example. However, I realized that this will not work because there is no clear way for me to bootStrap.init (MyStillers instance) is called for a special controller.

    Evenly, there is no way to access the controller example from within the filter. Of course, I can only model all the data, but I am wondering what is another great way to cross the data between the two?

    Thank you, Don

Passing your data in the model is very pleasant and easy is. You can also remove the data from the model in the filter, if you do not want it available for viewing for some reason.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -