Link to home
Start Free TrialLog in
Avatar of dreams4ever
dreams4ever

asked on

<bean:write> inside <html:textarea> tag

Hi

I need to display text in the text area which is stored as property of bean. The text can be in decimal/hexadecimal/normal text.

The below code isnt working for me:

<html:textarea property="sTranslatedText" style="width:300px" name="SessionDataBean"/>
The text is displayed as is.....i.e. if itz in decimal..then decimal...so on

<html:textarea property="phraseTranslatedText" style="width:300px">
         <bean:write property="sTranslatedText" name="SessionDataBean" filter="false" />
</html:textarea>
It doesn't display anything in the text area.

Can anyone tell me how to go abt it??

Thanks a lot!!!
Regards,


ASKER CERTIFIED SOLUTION
Avatar of fargo
fargo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Acton Wang

>><html:textarea property="phraseTranslatedText" style="width:300px">
         <bean:write property="sTranslatedText" name="SessionDataBean" filter="false" />
     </html:textarea>

      <html:textarea > will ignore what you provide inside the tag, even you write it as

      <html:textarea>  some text explicitly </html:textarea>

      It only prints out property value specified in the <html:textarea>.

      So what you might need to do is as following:
    <textarea name="phraseTranslatedText" style="width:300px">
         <bean:write property="sTranslatedText" name="SessionDataBean" filter="false" />
     </textarea>

      forgo's above method might prevent your phraseTranslatedText property from getting the value which is not your intention.

Acton
     Other way to do it (might be better) is that in your reset(..) function of your form bean:

      You add:
      phraseTranslatedText = sTranslatedText;

      and in your jsp, simply write:

      <html:textarea property="phraseTranslatedText" style="width:300px" />

Enjoy :)
Acton      
         

set what ever you want to display set it to var variable.

<html:textarea property='<% var %>'  style="width:300px" name="SessionDataBean"/>

try out.
i am sorry tht was.

<html:textarea property='<%= var %>'  style="width:300px" name="SessionDataBean"/>

>><html:textarea property='<%= var %>'  style="width:300px" name="SessionDataBean"/>
     ??
    phraseTranslatedText is already there, why var? not necessary. ..
Avatar of dreams4ever
dreams4ever

ASKER

Hey

I know that I can go with html tag textarea, but I was in the assumption that it can be done thru struts tag. I dont see any of the above will help me to go with struts tag.

Thanks a lot!!
Regards,
hi,

<html:textarea.. /> is a struts tag.

Please see here
http://www.roseindia.net/struts/strutsHtmlTags.shtml

fargo
Hi Fargo,

I meant that I can do it with html tag <textarea> using bean write but not with <html:textarea>.

Thanks a lot!!
Regards,
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial