Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

getting around html encoding in outputText tag (JSF)

Thread view: 
nadlox@gmail.com - 29 Nov 2005 08:45 GMT
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 &lt;BR&gt; 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 - 29 Nov 2005 09:57 GMT
<h:outputText> action has, luckily, escape attribute.
If it is set to false, <BR> would remain <BR>.
Try it.
nadlox@gmail.com - 29 Nov 2005 12:50 GMT
Excatly what I needed, thanks. Missed that one in JSF doc :)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.