Subject: inserting in Break in jsp
Posted By: austinf Post Date: 9/26/2006 1:05:58 AM
hi i have a string as follows in a java bean : this should put \r\n this sentence in \r\n two lines.

when i retrieve this in my jsp it displays as a single line.

i am using JSTL in my jsp, and since the escape sequence are not identified in html i replaced the "\r\n" with "<bR>" but when i see the page it comes as follows:
this should put <br> this sentence in <br> two lines.
and if u see the source it is like:
this should put &lt;br&gt; this sentence in &lt;br&gt; two lines.

i would like to know how to resolve this and also how to replace multiple \r, \n, in any sequence, with a single <BR>

Thanks in advance
Reply By: panacea Reply Date: 10/9/2006 8:53:22 PM
Um, are you sure you're doing a String.replace("\r\n", "<br>") ?  It seems like you're doing String.replace("\r\n", "&lt;br&gt;") instead.  Please confirm that you've tried simply "<br>" and used c:out with source="true".

Jon Emerson
http://www.jonemerson.net/

Go to topic 50790

Return to index page 153
Return to index page 152
Return to index page 151
Return to index page 150
Return to index page 149
Return to index page 148
Return to index page 147
Return to index page 146
Return to index page 145
Return to index page 144