0

I'm generating my facelets at java using StringBuilder. When I try to get generated code in my .xhtml page it shows only h:outputlabel text. But when i'm opening my page code it shows something like this.

</style><span class="preformatted"><h:form style="margin: 0 auto"><h:panelGrid columns="1"><h:outputLabel id="label" for="descr">descr</h:outputLabel>  <div> <b:inputText required="true" id="descr" value="#{parserBean.listWithData[0]}"></b:inputText></div><h:outputLabel id="label" for="birthday">birthday</h:outputLabel><p:calendar id="birthday" value="#{parserBean.listWithData[1]}" pattern="MM/dd/yyyy HH:mm:ss" /><h:outputLabel id="label" for="place">place</h:outputLabel>    <div> <b:inputText required="true" id="place" value="#{parserBean.listWithData[2]}"></b:inputText></div></h:panelGrid> </h:form></span></body>

What the problem? Can I dynamically create my facelets in java? Or how to convert it? Here is my .xhtml page

  <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:b="http://bootsfaces.net/ui"
    xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
<h:head>
    <title>Add data</title>
    <h:outputScript library="js" name="jquery-3.2.1.min.js" />
</h:head>
<h:body>
    <h:form>
        <b:commandButton look="link" action="response?faces-redirect=true"
            value="Response" />
        <b:commandButton look="link" action="fields?faces-redirect=true"
            value="Fields" />
    </h:form>
    <style>
.preformatted {
    white-space: pre;
}
</style>
    <h:outputText class="preformatted" escape="false"
        value="#{parserBean.parseToHtml()}" />
</h:body>

</html>
Serg Shapoval
  • 707
  • 1
  • 11
  • 39
  • Possible duplicate of [Include dynamic content containing JSF tags/components from stream](http://stackoverflow.com/questions/20268860/include-dynamic-content-containing-jsf-tags-components-from-stream) – Jasper de Vries Apr 17 '17 at 06:55
  • See also [Obtaining Facelets templates/files from an external filesystem or database](http://stackoverflow.com/questions/13292272/obtaining-facelets-templates-files-from-an-external-filesystem-or-database) – Jasper de Vries Apr 17 '17 at 06:56

0 Answers0