Until that is fixed, you should be able to subclass the myfaces message renderer and do the escaping yourself

On 1/11/06, Konstantin Shaposhnikov < [EMAIL PROTECTED]> wrote:
On 1/11/06, Matthias Kahlau < [EMAIL PROTECTED]> wrote:
>
> Hi!
>
> I thought the renderer of h:message does replace the line terminator
> sequence \n with HTML, but that seems not to be the case. I tested to use
> "&lt;br/&gt;" (without double quotes), and this also doesn't work. The
> string is just diplayed as text. (I also tried <br> without success.)
>
> I think it's an important use case to display error messages in multiple
> lines. Does anybody have a solution, or is this just impossible at the
> moment?

Currently this is impossible. But there is issue in MyFaces JIRA
(http://issues.apache.org/jira/browse/MYFACES-972) with patch to add
'escape' attribute to t:message and t:messages.

> Regards,
>
> Matthias
>
> -----Ursprüngliche Nachricht-----
> Von: users-return-15025-mkahlau= [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]Im
> Auftrag von Andrew Robinson
> Gesendet: Dienstag, 10. Januar 2006 16:34
>
> An: MyFaces Discussion
> Betreff: Re: How to define line breaks in a resource bundle message?
>
> Are you sure \n isn't working? (Remember that \n is meaningless in html (it
> is a space))
>
> If you are using  output text, and you want a new line in HTML you may have
> to use "&lt;br/&gt;". I haven't tested this, but I'd imagine this may work
> for you
>
>
> On 1/10/06, Matthias Kahlau <[EMAIL PROTECTED]> wrote:
> > Hi Dave,
> >
> >
> > many thanks. If my understanding is correct, the line terminator sequence
> \n
> > should work. But I tried it using h:message, and it doesn't work. Is it
> > possible that h:message is not capable of rendering the line terminator
> > sequence appropriately?
> >
> >
> >
> > Regards,
> >
> > Matthias
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: users-return-15012-mkahlau= [EMAIL PROTECTED]
> > >
> [mailto:[EMAIL PROTECTED] ]Im
> Auftrag
> > > von Dave Brondsema
> > > Gesendet: Dienstag, 10. Januar 2006 14:27
> > > An: MyFaces Discussion
> > > Betreff: Re: How to define line breaks in a resource bundle message?
> > >
> > >
> > > Matthias Kahlau wrote:
> > > > Hi!
> > > >
> > > >
> > > > Is it possible to define a line break in a resource bundle
> > > message used for
> > > > h:message? I already tried \n and <br>, but that didn't work...
> > > >
> > >
> > > Resource bundles use a java Properties class.  See the "load" method at
> > >
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html
> > >
> > >
> > > --
> > > Dave Brondsema
> > > Software Developer
> > > Cornerstone University
> > >
> >
> >
>
>

Reply via email to