You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by struts <st...@pandora.be> on 2003/10/29 14:41:27 UTC
html:hidden +session
how can i print a session value in a hidden field.
This doesn't work...
<html:hidden property="users.userAccount" value="<session:attribute name="userAccount"/>"/>
any solutions ?
Thanks
Re: html:hidden +session
Posted by Caroline Lauferon <ca...@cgey.com>.
I'm quite sure you can use scriptlet in your struts tags :
<html:hidden property="users.userAccount"
value="<%=request.getSession().getAttribute("userAccount")%>"/>
Caroline
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: html:hidden +session
Posted by struts <st...@pandora.be>.
error: According to the TLD attribute name is mandatory for tag write
thx
----- Original Message -----
From: "EL AKARI Mehdi" <me...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, October 29, 2003 3:11 PM
Subject: Re: html:hidden +session
> You can do it either like that :
>
> <bean:define id="myValue" >
> <bean:write property="userAccount" scope="session" />
> </bean:define>
> <html:hidden property=="users.userAccount" value="<%=myValue%>" />
>
> or like that (using JSTL) :
>
> <c:set var="myValue" >
> <bean:write property="userAccount" scope="session" />
> </c:set>
> <html-el:hidden property=="users.userAccount" value="${myValue}" />
>
> I hope that it will help
> Mehdi
>
> ----- Original Message -----
> From: "struts" <st...@pandora.be>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, October 29, 2003 1:41 PM
> Subject: html:hidden +session
>
>
> how can i print a session value in a hidden field.
>
> This doesn't work...
>
> <html:hidden property="users.userAccount" value="<session:attribute
> name="userAccount"/>"/>
>
> any solutions ?
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: html:hidden +session
Posted by Mark Lowe <ma...@talk21.com>.
If the variable users.userAccount is in an available scope it will be
there anyway, without all the messing around.
..
session.setAttribute("users",...);
..
<html:hidden property="users.userAccount" />
if you've a getUserAccount() method as a property of user it will work
like this.
On Wednesday, October 29, 2003, at 02:11 PM, EL AKARI Mehdi wrote:
> You can do it either like that :
>
> <bean:define id="myValue" >
> <bean:write property="userAccount" scope="session" />
> </bean:define>
> <html:hidden property=="users.userAccount" value="<%=myValue%>" />
>
> or like that (using JSTL) :
>
> <c:set var="myValue" >
> <bean:write property="userAccount" scope="session" />
> </c:set>
> <html-el:hidden property=="users.userAccount" value="${myValue}" />
>
> I hope that it will help
> Mehdi
>
> ----- Original Message -----
> From: "struts" <st...@pandora.be>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, October 29, 2003 1:41 PM
> Subject: html:hidden +session
>
>
> how can i print a session value in a hidden field.
>
> This doesn't work...
>
> <html:hidden property="users.userAccount" value="<session:attribute
> name="userAccount"/>"/>
>
> any solutions ?
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: html:hidden +session
Posted by EL AKARI Mehdi <me...@hotmail.com>.
You can do it either like that :
<bean:define id="myValue" >
<bean:write property="userAccount" scope="session" />
</bean:define>
<html:hidden property=="users.userAccount" value="<%=myValue%>" />
or like that (using JSTL) :
<c:set var="myValue" >
<bean:write property="userAccount" scope="session" />
</c:set>
<html-el:hidden property=="users.userAccount" value="${myValue}" />
I hope that it will help
Mehdi
----- Original Message -----
From: "struts" <st...@pandora.be>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, October 29, 2003 1:41 PM
Subject: html:hidden +session
how can i print a session value in a hidden field.
This doesn't work...
<html:hidden property="users.userAccount" value="<session:attribute
name="userAccount"/>"/>
any solutions ?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org