getting around html encoding in outputText tag (JSF)  
Author Message
nadlox@gmail.com





PostPosted: 2005-11-29 16:46:00 Top

java-programmer, getting around html encoding in outputText tag (JSF) Hi,

I'm getting a value to my JSP page (using JSF) with outputText from a
bean that has html encoding in it.

How could I temper with the HTML encoding so that I could preserve
certain tags? I need to have a few <BR> inside the text and want'em
displayed in HTML code, not <BR> etc...

What I'm doing is having a properties file for end users to modify. And
since there are some longer texts, they want to add paragraphs and line
breaks every now and then. So I've written a method that searches the
string for example \n and replaces'em with <br> just before this string
is sent to JSP. But now the encoding happens...

Or what would be the smartest way?

Regards,
Niko

 
hiwa





PostPosted: 2005-11-29 17:58:00 Top

java-programmer >> getting around html encoding in outputText tag (JSF) <h:outputText> action has, luckily, escape attribute.
If it is set to false, <BR> would remain <BR>.
Try it.

 
nadlox@gmail.com





PostPosted: 2005-11-29 20:50:00 Top

java-programmer >> getting around html encoding in outputText tag (JSF) Excatly what I needed, thanks. Missed that one in JSF doc :)