0

I have a <h:outputText> which displays some description (Alphanumeric + emoticons).

Here is my issue. I want to allow only specific tag (in my case <img> tag for emoticons) to be allowed in the outputText. I currently have, <h:outputText id='someid' escape='false'/> which allows all the html tags. Is there anyway I can allow my <img> and escape all other tags?

I'm open to using jquery as well but not sure how to go ahead with it.

Note: I'm using Primefaces and the outputText value is pre-fetched from EO and displayed on page load.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Java_User
  • 1,303
  • 3
  • 27
  • 38
  • Thanks @BalusC for the alternate link. But is it that complex to have a jquery/js function just for allowing the tag instead of using a parser? – Java_User Jan 28 '16 at 12:51
  • In JS/jQuery it's too late. HTML has at that point already been produced by server and consumed by client. – BalusC Jan 28 '16 at 13:00

0 Answers0