Re: Adding cookie in a DA handler
Re: Adding cookie in a DA handler
- Subject: Re: Adding cookie in a DA handler
- From: Lachlan Deck <email@hidden>
- Date: Sun, 13 Jan 2008 21:41:30 +1100
On 13/01/2008, at 4:34 AM, Miguel Arroz wrote:
Looks like calling generateResponse() before the addCookie stuff
makes it work.
Indeed as the response is only created during generateResponse.
Now I have another problem, the cookie is beeing erased somewhere
between that and the response is actually sent to the browser. Oh
well...
That would suggest to me that you're not retaining that response but
returning the component in your DA -- which would subsequently have
it's content generated again.
So do this:
public WOActionResults someDirectAction()
{
WOComponent page = pageWithName( ... );
WOResponse response = page.generateResponse();
if( doNotShowPopupAgainCookie != null ) {
NSLog.out.appendln( "******************* response: " +
showSurveyComponent.context().response() );
response.addCookie( doNotShowPopupAgainCookie );
}
return response;
}
with regards,
--
Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden