0

I am building a blog application using JSF and Primefaces. I added the CKeditor through primefaces extensions. It is correctly producing html output, however when displayed in a browser all of the html tags are displayed instead of interpreted by the browser. For example here is the some test output.

Screenshot of CkEditor output:

Screenshot of CkEditor output

Looking in developer tools the above content has quotes around it. I'm assuming if I can figure out how to get rid of the quotes it will display as html.

The JCP code to display the above

<h:outputText value="#{(editorBean.postMarkup)}"></h:outputText>

Currently only have simple getters and setters in the backing bean.

   public String getPostMarkup() {
        return this.postMarkup;
    }

    public void setPostMarkup(String postMarkup) {
        this.postMarkup = postMarkup;
    } 

Ultimately I would like to store raw HTML in the database to be displayed on a blog page. How can I get rid of the quotes if that is indeed the problem?

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
JHRS
  • 367
  • 4
  • 11

1 Answers1

0

use escape=false on h:outputText.

tandraschko
  • 2,291
  • 13
  • 13