<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,


dreams4everAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
Hi,

You can surely display the bean property in text area as follows
<html:textarea style="width:380" styleClass="textarea" property="sTranslatedText" rows="5" cols="30" ></html:textarea>

>> The text is displayed as is.....i.e. if itz in decimal..then decimal...so on
What do u mean by above sentence?

fargo

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
actonwangCommented:

>><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
0
actonwangCommented:
     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      
         
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Siva Prasanna KumarPrincipal Solutions ArchitectCommented:

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

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

try out.
0
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
i am sorry tht was.

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

0
actonwangCommented:
>><html:textarea property='<%= var %>'  style="width:300px" name="SessionDataBean"/>
     ??
    phraseTranslatedText is already there, why var? not necessary. ..
0
dreams4everAuthor Commented:
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,
0
fargoCommented:
hi,

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

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

fargo
0
dreams4everAuthor Commented:
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,
0
actonwangCommented:
>>    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" />

       

       Haveyou tried this? It SHOULD work!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.