This might work but you're ignoring the relationship between Struts HTML
form tags and ActionForms.  All you need to do is prefill the values in the
action leading to your JSP, then add the form element to your pages and it
will be filled.  All you need is:

<html:hidden property="users.userAccount" />

If you don't want to prefill your form in the Action for some reason, then
the easiest way to get the value, IMO, is with Struts-el, where you can use
this:

<html-el:hidden property="users.userAccount"
value="${sessionScope.myBean.myProperty}" />

Greg


-----Original Message-----
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 29, 2003 9:04 AM
To: Struts Users Mailing List
Subject: RE: html:hidden +session


Struts has nothing to do with it. That's a general JSP syntax error pure and
simple. What do you want the rendered HTML <input> element to look like? Do
you
really want:

<input type="hidden" name="users.userAccount" value="userAccountValue">

If so, you can do:

<input type="hidden"
       name="users.userAccount"
       value="<bean:write name="userAccount" scope="session"/>">

Quoting [EMAIL PROTECTED]:

> neted tags i guess are not available in struts?
>
> -----Original Message-----
> From: struts [mailto:[EMAIL PROTECTED]
> Sent: 29 October 2003 13:41
> To: Struts Users Mailing List
> 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

--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

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



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

Reply via email to