Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying HTML on a JSF web Page

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18002
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic