Win a copy of Reactive Design Patterns this week in the Functional Programming forum
or Learn Linux in a Month of Lunches in the Linux forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF2.2 h:outputText hanging when value to display is HTML

 
David Hickman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am using JSF2.2 and Primefaces 6. I have an xhtml file where h:outputText escape="false" is meant to display the output from a BIRT generated report in HTML format but for some reason it just hangs.
If I change to escape="true" the generated HTML is displayed, if I copy this generated HTML into a separate file and open that in a browser it is fine so I think the HTML is good but for some reason it will not display in h:outputText

 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15692
73
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's really hard to say why this happens from just your description and lines of code.

What does the getCounterpartyReport() method in the bean named reportBean look like? Does it do a heavy database query? Note that getter methods in managed beans must normally not do any "work" like executing a database query. You should put the query in an initializer method of the managed bean, then let that store the results of the query in a member variable, and then let the getter method only return the content of the member variable. This is because the JSF runtime may call the getter method multiple times, and if you'd be doing a database query in the getter method itself, then you'd be performing that query multiple times for the same request, which is inefficient and can make your webapp unnecessarily slow.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!