myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From António Rodrigues <>
Subject Re: How to elegantly replace line breaks with <BR> tag?
Date Fri, 26 Feb 2010 15:48:44 GMT
I add that problem also because I wanted to display the text exactly as it
was entered in a text area.

You can create a custom converter and then add it to the components where
you want to use it.
But the most elegant way is to create a facelet.

This is what I did.
- I have created a custom converter that converts \n into <br/> and spaces
into &nbsp;
- I have created a facelet as follows.

<ui:composition xmlns=""

    <h:panelGroup rendered="#{empty rendered or rendered}">
        <h:outputLabel value="#{value}"

So when I want a paragraph I just use the facelet tag

<mytags:textParagraph styleClass="paragraphFont"
rendered="#{myBean.display}" value="#{myBean.conclusion}" />


On 22 February 2010 17:45, laredotornado <> wrote:

> 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:
> Sent from the MyFaces - Users mailing list archive at

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