You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by congzhebin <zh...@jhtop.com> on 2002/08/16 15:05:59 UTC

how can i set up the value of the html:text and html:textarea?

hello
i want to setup the value of html:text and html:textarea,but both of the following two expression don't work:

<html:text property="name" size="20" value=<bean:write name="msgBoard" property="name" scope="session"/>/>


<html:text property="name" size="20" value="<bean:write name="msgBoard" property="name" scope="session"/>"/>

who can help me? 

thank you very much


Re: how can i set up the value of the html:text and html:textarea?

Posted by Robert Williams <rj...@attbi.com>.
Here is an example that shows another trick I got from some folks on this
list.  Define a Java variable and insert it in place of the Struts tag.
Remember tags are interpreted at compile time and replaced with Java code.
Therefore you can't "nest" tags from any taglib.  You have to resort to pure
JSP for nesting purposes.

  <bean:define id="thisValue" name="decl"
     type="java.lang.String" />
  <html:text property="declarations"
     value="<%= thisValue%>" size="50"/>


bob

----- Original Message -----
From: "Gemes Tibor" <ge...@regens.hu>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, August 16, 2002 8:51 AM
Subject: Re: how can i set up the value of the html:text and html:textarea?


2002. augusztus 16. 15:05 dátummal congzhebin ezt írtad:
> hello
> i want to setup the value of html:text and html:textarea,but both of the
> following two expression don't work:
> <html:text property="name" size="20" value=<bean:write name="msgBoard"
> property="name" scope="session"/>/>
>
> <html:text property="name" size="20" value="<bean:write name="msgBoard"
> property="name" scope="session"/>"/>

You should populate your FormBean in the Action that takes you to this page,
and then use only the "property" attribute and omit the "value" attribute.

Hth,

Tib

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: how can i set up the value of the html:text and html:textarea?

Posted by Gemes Tibor <ge...@regens.hu>.
2002. augusztus 16. 15:05 dátummal congzhebin ezt írtad:
> hello
> i want to setup the value of html:text and html:textarea,but both of the
> following two expression don't work:
 
> <html:text property="name" size="20" value=<bean:write name="msgBoard"
> property="name" scope="session"/>/>
 
> 
> <html:text property="name" size="20" value="<bean:write name="msgBoard"
> property="name" scope="session"/>"/>
 

You should populate your FormBean in the Action that takes you to this page, 
and then use only the "property" attribute and omit the "value" attribute.

Hth,

Tib

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>