0

I'm new to JSF. I'm having a problem with my JSF applciation.

I need to display user's input HTML contents (which created with Primefaces editor) in my application. Users need to print it out on papers with browser's "Print" function.

<h:outputText value="#{backingBean.htmlContents}" escape="false" />

Most of the time it works fine but sometimes the page does not render correctly. I suspect it was caused by mixing up JSF tags and HTML tags!?

I tried to use:

<p:editor disabled="true" value="#{backingBean.htmlContents}"> 

instead. But it does not display everything when the content is too long. and it seems that there is no way to make it auto resize its height based on the length of the content.

Does anyone have the same problem? how did you solve it?

Any help will be greatly appreciated.

Melway
  • 1
  • 3
  • 1
    "*I suspect it was caused by mixing up JSF tags and HTML tags.*" Browsers know absolutely nothing about JSF. The response being rendered is in the form of pure HTML/JavaScript/CSS. You had better turn the page view into what is called "print preview" before being printed by a printer device. – Tiny Sep 16 '15 at 06:22
  • Apparently the user inputted a `` or so? Do you realize what you're actually doing there? – BalusC Sep 16 '15 at 09:08
  • Nonetheless, food for read as you're apparently not only new to JSF, but also new to basic HTML, web development, security, etc: http://stackoverflow.com/q/7722159, http://stackoverflow.com/q/2905886 and http://stackoverflow.com/q/3364427 – BalusC Sep 16 '15 at 09:11

0 Answers0