File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 17410

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
It's not a secret anymore!