tags:

views:

194

answers:

1

How do you display data in a 'textarea' using struts application,

This is my code:

<html:textarea property="comments" </html:textarea>
<bean:write name="FormBean" property="comments"/>

where FormBean is my beanclass and comment is a property in beanclass.

But I cannot get it too work.

Thanks in advance for your help.

A: 

If you use Struts action forms and you have the html:textarea tag inside your html:form tag (this tag is only valid when nested inside a form tag body) then the following code is all you need:

<html:textarea property="comments" />

Don't know what you are trying to do with bean:write but if you want to display that inside your html:textarea I'm not sure you can. The property attribute is mandatory for the html:textarea tag and will use that as the content.

dpb
thanks for your help.its working for me..
Manu
i have another problem. i want to use "if condition and while loop" in struts1 framework. i have Bean class with setter() and getter() methods for fname and lname property. how to use that bean variable in jsp for checking if condition and looping. how to check if condi..if i want to check like if(firstname==lastname)pls reply ASAP
Manu
Glad to hear that now it works. As a result I consider this post to be answered. Regarding your second comment, I am posting an answer on the other question you specially created for it (http://stackoverflow.com/questions/2234841/i-have-bean-class-with-setter-and-getter-methods-for-fname-and-lname-proper). Follow it there.
dpb