This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JSF and the fly likes Displaying HTML on a JSF web Page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Displaying HTML on a JSF web Page" Watch "Displaying HTML on a JSF web Page" New topic

Displaying HTML on a JSF web Page

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
I have the folowing entry in the database

and i will like it to display on my web page, it should escape the html and the word this needs to be bold,

I have tried hutputText , escapeHtml ="true" and escapeHtml="false" and the word this is not bold

Please how do i resolve this
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17277

I strongly recommend not putting raw HTML in an outputText element. I've seen problems come from that approach, and not only on the JSF platform. A more JSF-friendly (if less terse) solution for panelGrid and table cells looks like this:

Actually, use of the <em> tag even in non-JSF HTML in this day and age will get you abused by some people. CSS is the preferred mechanism now.

However, if you absolutely insist on using raw HTML in an outputText, the proper attribute name isn't "escapeHTML", it's simply "escape".

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Displaying HTML on a JSF web Page
jQuery in Action, 3rd edition