You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rebecca Case <mr...@yahoo.com> on 2010/06/21 17:33:04 UTC

Is CookiesAware read only?

I'm wanting to be able to create a cookie if it doesn't exist yet and update it if the cookie is already existing.  Is this possible using CookiesAware and the cookie interceptor or are these read only?  I realize that this can be accomplished by using the request and response directly, but I was sort of hoping it was possible without having to do that.  I haven't been able to find any examples.

Thanks in advance for any help.


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Is CookiesAware read only?

Posted by Chris Pratt <th...@gmail.com>.
Yes, CookiesAware is meant to inject the cookies, individually or the entire
Map, into the action.  It is effectively read-only.  As far as I know the
only way to add a cookie is to get the HttpServletResponse (using
ServletResponseAware would be the suggested method) and adding it using
ServletResponseAware.addCookie().
  (*Chris*)

On Mon, Jun 21, 2010 at 8:33 AM, Rebecca Case <mr...@yahoo.com> wrote:

> I'm wanting to be able to create a cookie if it doesn't exist yet and
> update it if the cookie is already existing.  Is this possible using
> CookiesAware and the cookie interceptor or are these read only?  I realize
> that this can be accomplished by using the request and response directly,
> but I was sort of hoping it was possible without having to do that.  I
> haven't been able to find any examples.
>
> Thanks in advance for any help.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>