This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Displaying HTML on a JSF web Page" Watch "Displaying HTML on a JSF web Page" New topic
Author

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: 15952
    
  19

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".


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Displaying HTML on a JSF web Page
 
Similar Threads
HFSJ P408 jsp Include tag example
Expression Language is not working in Jsp Tags
Does XSLT template declaration order matter?
please solve this EL
Unable to display the image file in the jsp