Harini
Harini

Reputation: 105

how will display my html file which is the string format in JSF?

Can someone help? I am really new to JSF. I just want to know how to Display my Html in the JSF page. My Html file is in the String Format. Say for example

     str="<html>.........<h1> display this portion </h1>........</html>";

Can i Use Javascript to display this in my JSF?

Upvotes: 1

Views: 1477

Answers (1)

Mr.J4mes
Mr.J4mes

Reputation: 9266

I can think of 2 options:

  1. <h:outputText value="#{mrBean.htmlString}" escape="false" />
  2. Or else, just make sure that all the tags in your HTML files are closed properly and all of them must have root tags. Then you can include your file with:

    <ui:include src="myFile.html" />
    

Upvotes: 2

Related Questions