Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

outputLabel and line breaks doesn't work - Is there a hack for JSF1.2?

843844Jun 21 2007 — edited Jun 21 2007
Hello,

I use JSF 1.2 and Facelets to generate a form automatically. This works so far well. But if I have a label with line breaks, JSF does not convert the line breaks into �
� tags. Is there a hack to convert line breaks into �
� tags?

A little example

Code:
<h:outputLabel value="#{component.label}" for="#{component.id}" />
<h:inputText value="#{component.value}" id="#{component.id}" />
component.label = �First Line\nSecond Line�
component.value = "UserInput"

This is rendered to:
First Line Second Line      [UserInput] 
Instead of:
First Line        [UserInput]
Second Line 
One possible solution is to disable �escape�. But this is a bad solution because there are umlauts and angle brackets (�<�,�>�) in some texts for my labels. Does anyone know a better solution?

Regards
Martin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 19 2007
Added on Jun 21 2007
3 comments
446 views