I want to style some text witch is wrapped in a html <code> tag. But the styling is done in server side class. For e.g.:
myValue.replaceAll(" " + textToStyle + " ", " <span style=\"color: orange;\"> " + textToStyle + "</span> ");
This lines goes as text which is wrapped in <code> tag. The text is displayed in JSF datatable:
<h:column>
<code class="dt_row">
#{myList.myValue}
</code>
</h:column>
<code> tag css class:
.dt_row {
height: 8px;
margin: 3px 3px 3px 3px;
color: #000000;
font-size: 12px;
}
The problem is when the html is rendered in a browser the code is displayed with all tags. I want that not this <span style=\"color: orange;\"> will be displayed in page but the text value in orange color.
Any ideas how to achieve that?
Instead of
you may try
Setting “escape” to false should do the work (otherwise the framework will escape the String…).