You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Turner Benjamin <Be...@cronos.be> on 2004/02/13 10:03:06 UTC

newlines

hello,

i looked in the archives about this problem but couldn't find anything useable. 

i have text data which contains newlines (\n) which has been entered via textarea's. on a different page i wish to present this data with the newlines converted to <br/>'s. i however don't want to turn the filter="" option of bean:write off, since this would enable possible misformatting if the user were to enter html data.

is there a clean solution to this? <pre> is also not an option since this makes for lines being endlessly long.

tia,

Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: newlines

Posted by Ravi Kulkarni <rk...@applabs.net>.
Hello,

I have the same requirement in my project. I am thinking to write a utility
method to convert "\n" to "<br>".

I am also looking for the same problem. Does any one have faced  similar
problem. It would be very helpful if anyone share their experiences with
this kind of situation.


TIA,
Kulkarni

-----Original Message-----
From: Turner Benjamin [mailto:Benjamin.Turner@cronos.be]
Sent: Friday, February 13, 2004 2:33 PM
To: Struts-User (E-mail)
Subject: newlines


hello,

i looked in the archives about this problem but couldn't find anything
useable.

i have text data which contains newlines (\n) which has been entered via
textarea's. on a different page i wish to present this data with the
newlines converted to <br/>'s. i however don't want to turn the filter=""
option of bean:write off, since this would enable possible misformatting if
the user were to enter html data.

is there a clean solution to this? <pre> is also not an option since this
makes for lines being endlessly long.

tia,

Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: newlines

Posted by Navjot Singh <na...@net4india.net>.
can you replace the \n to <br/> before sending to jsp 

>-----Original Message-----
>From: Turner Benjamin [mailto:Benjamin.Turner@cronos.be]
>Sent: Friday, February 13, 2004 2:33 PM
>To: Struts-User (E-mail)
>Subject: newlines
>
>
>hello,
>
>i looked in the archives about this problem but couldn't find 
>anything useable. 
>
>i have text data which contains newlines (\n) which has been 
>entered via textarea's. on a different page i wish to present this 
>data with the newlines converted to <br/>'s. i however don't want 
>to turn the filter="" option of bean:write off, since this would 
>enable possible misformatting if the user were to enter html data.
>
>is there a clean solution to this? <pre> is also not an option 
>since this makes for lines being endlessly long.
>
>tia,
>
>Ben
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org