struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Hartmann <andihartm...@freenet.de>
Subject Re: Defining dynamic default value for a cookie
Date Mon, 28 Aug 2006 17:43:40 GMT
Hello Puneet!

Puneet Lakhina wrote:
> On 8/28/06, Andreas.Hartmann@fiducia.de <Andreas.Hartmann@fiducia.de> wrote:
>>
>>
>> Hello!
>>
>> I'm trying to define a default value in the jsp for a cookie, but I don't
>> know
>> how to do it :-(.
>>
>> I've go the following piece of code:
>>
>> ...
>> <bean:write name="Integrationmenuform" property="pname"/>
>> <bean:cookie id="cpname" name="CookieCname" value=""/>
>> ...
>>
>> I would like to have the output from the bean:write - tag as input for the
>> value
>> in the bean::cookie - tag:
>> <bean:cookie id="cpname" name="CookieCname" value='<bean:write
>> name="Integrationmenuform" property="pname"/>'/>
> 
> Try
> <bean:cookie id="cpname" name="CookieCname"
> value='<%=((YourType)request.getAttribute("Integrationmenuform")).getPname()%>'
> />
> This is assuming your bean is in request scope, make appropriate changes
> incase the bean is in session scope.

Yes, it's in the request scope. Should work. I'll test it tomorrow. It's
really a pity that the struts taglibs don't work in any case. Will there
be a solution in the future :-)?

> 
> Dont think this solution is pleasing to the eye....:-)

If it works ... .


Thanks for yout hint,
kind regards,
Andreas Hartmann

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


Mime
View raw message