sai reddy wrote:
I'm a newbie to struts. I wanted to practice <bean:cookie> tag's 'multiple' attribute.
But the problem is i don't know how to set multiple cookies.
Please help me.

I tried this code to set multiple cookies.......but only the last
cookie gets added.......i mean the first one gets replaced by the
second cookie resulting in only one cookie set at the end.

##################################################################
##    response.addCookie(new Cookie("animal","dog"));        ##
##    response.addCookie(new Cookie("animal","cat"));        ##
##################################################################

Please tell me how to set multiple cookies......

You can't have multiple cookies with the same name. Either name each cookie differently or, if you want a single cookie with multiple values, you will need to explicitly combine them into a single value (e.g. by encoding them as a comma separated list). The code above is just saying "set the value of the 'animal' cookie 'dog', then *reset* it to 'cat'".

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to