filter "after" parameters?

View: New views
7 Messages — Rating Filter:   Alert me  

filter "after" parameters?

by alebo611 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

How do I obtain the parameters that was returned from the controller in an "after" filter??

for example, if I have a FooController:

def list = {
 
[Foo.list()]

}

how do I get this list in the "after" filter??? In the documentation there is a list of parameters: session, response etc. But I have not managed to get any data from them.  Yes, Im a newbie...



Re: filter "after" parameters?

by Peter Willis-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

yourFilterName(controller:'foo', action:'list'){

after = { model -> 

     // work on it

}
}

On Mon, Oct 26, 2009 at 5:52 PM, alebo611 <abogardi@...> wrote:

Hi

How do I obtain the parameters that was returned from the controller in an
"after" filter??

for example, if I have a FooController:

def list = {

[Foo.list()]

}

how do I get this list in the "after" filter??? In the documentation there
is a list of parameters: session, response etc. But I have not managed to
get any data from them.  Yes, Im a newbie...



--
View this message in context: http://www.nabble.com/filter-%22after%22-parameters--tp26063336p26063336.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: filter "after" parameters?

by alebo611 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot!!! This should be in the official doc..




Peter Willis-5 wrote:
yourFilterName(controller:'foo', action:'list'){

after = { model ->

     // work on it

}

}

On Mon, Oct 26, 2009 at 5:52 PM, alebo611 <abogardi@gmail.com> wrote:

>
> Hi
>
> How do I obtain the parameters that was returned from the controller in an
> "after" filter??
>
> for example, if I have a FooController:
>
> def list = {
>
> [Foo.list()]
>
> }
>
> how do I get this list in the "after" filter??? In the documentation there
> is a list of parameters: session, response etc. But I have not managed to
> get any data from them.  Yes, Im a newbie...
>
>
>
> --
> View this message in context:
> http://www.nabble.com/filter-%22after%22-parameters--tp26063336p26063336.html
> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

Re: filter "after" parameters?

by Peter Ledbrook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Thanks a lot!!! This should be in the official doc..

It is. See section 6.6.

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: filter "after" parameters?

by alebo611 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes now I see It.

Another question. It seems like the filter sometimes is called
several times for one controller closure. Is this normal?

/Alexander



Peter Ledbrook wrote:
> Thanks a lot!!! This should be in the official doc..

It is. See section 6.6.

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Re: filter "after" parameters?

by Peter Ledbrook :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Another question. It seems like the filter sometimes is called
> several times for one controller closure. Is this normal?

I don't think so. Only if the controller action is called more than
once. What behaviour are you seeing?

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: filter "after" parameters?

by alebo611 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think maybe it was due to recompliation, similar to
duplicated links. I dont have this problem anymore.



Peter Ledbrook wrote:
> Another question. It seems like the filter sometimes is called
> several times for one controller closure. Is this normal?

I don't think so. Only if the controller action is called more than
once. What behaviour are you seeing?

Peter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email