You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Krishna, Mattam (M.)" <mk...@ford.com> on 2006/03/10 14:13:30 UTC
bean:write will not recognize \n or \t
I have the following code in jsp.
<html:textarea name="empOtherDevFocusBO" cols="512" rows="3"
property="focusText" />
Here I am enterd the following text:
Test
Test.
Note:I typed Test and then enter key then tab then Test.
After I submit the html:form , it stores the value perfectly in DB.
After when I tried to display that value by using bean:write it won't
recognize the \n and \t.
Simply it display the value as follows: Test Test
But actually required is :
Test
Test
I think this is due to bean:write will not recognize the \n and \t.
But I want to display the values as user enters.
Is there any other solutions.
Thanks and Regards,
Krishna Mattam
Team Member - CDF Toolset
Contact:044-22548575
Email: mkrish17@ford.com
<ma...@ford.com>
Re: bean:write will not recognize \n or \t
Posted by David Delbecq <de...@oma.be>.
Krishna, Mattam (M.) a écrit :
>I have the following code in jsp.
><html:textarea name="empOtherDevFocusBO" cols="512" rows="3"
>property="focusText" />
>Here I am enterd the following text:
>Test
> Test.
>Note:I typed Test and then enter key then tab then Test.
>After I submit the html:form , it stores the value perfectly in DB.
>After when I tried to display that value by using bean:write it won't
>recognize the \n and \t.
>
>
bean:write output the specified property value in the jspwriter. Not
less, not more. If your property has a linefeed and a tab, they will be
outputed to jspwriter.
>Simply it display the value as follows: Test Test
>
>
Which is the correct display for
Test
Test
in a browser. (linefeed and tab are space separatator. To break a line
in html, use <br/> or <p/>
>But actually required is :
>Test
> Test
>I think this is due to bean:write will not recognize the \n and \t.
>
>
bean:write does no operations on your property other than formatting it
if a format is need (like dates and numbers), if you want your display
in a browser, you should output
<pre>Test
Test</pre>
>But I want to display the values as user enters.
>Is there any other solutions.
>
>Thanks and Regards,
>Krishna Mattam
>Team Member - CDF Toolset
>Contact:044-22548575
>Email: mkrish17@ford.com
>
>
>
> <ma...@ford.com>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org