myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Korherr <jakob.korh...@gmail.com>
Subject Re: How to elegantly replace line breaks with <BR> tag?
Date Mon, 22 Feb 2010 17:45:52 GMT
Hi,

You can provide a special getter method in your managed bean for that
(something like getResultWithLineBreaks()) and replace "\n" with "<br />" in
the return value of method. Then you have to change your t:outputText
component to:

<t:outputText value="#{currentRow.resultWithLineBreaks}" escape="false" />

Regards,
Jakob

2010/2/22 laredotornado <laredotornado@gmail.com>

>
> Hi,
>
> I'm using MyFaces 1.1.5 with Tomahawk 1.1.7 (Java 1.5, Resin, 3.0.19).  Is
> there a way in JSF where I can replace the "\n" (chr(13) carriage return
> character) with the "<BR/>" tag in my outputText block?  Right now I have
>
> <t:outputText value="#{currentRow.result}" />
>
> Thanks, - Dave
> --
> View this message in context:
> http://old.nabble.com/How-to-elegantly-replace-line-breaks-with-%3CBR%3E-tag--tp27690198p27690198.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message