Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF Bootsfaces components not showing

Tags:

jsf

bootsfaces

Today I was working on our application for a school project. We had no problems with the our Bootsfaces but suddenly I can't seem to get the components to show (see image). I don't know what's causing this unexpected behaviour because it worked before. Nothing has been changed to the .xhtml page. The error log in the Chrome console and the Payara console are both giving 0 errors.

I am using Payara 5.181 and Java EE 7.

Edit:

Removing the "generated" folder in the Payara server and restarting the PC seems to solve this problem, but after a while (can't reproduce exactly why) the page turns blank again.

Screenshot of the page

.xhtml file

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:b="http://bootsfaces.net/ui"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Kies je cartracker</title>
        <h:outputStylesheet name="default.css" library="css" />
    </h:head>
    <h:body>
        <h1>Kies je cartracker:</h1>
        <b:dataTable value="#{tourmanager.allCartrackers}" 
                     var="tracker">
            <b:dataTableColumn>
                <f:facet name="header">
                    <h:outputText value="Vehicle" />
                </f:facet>
                <h:outputText value="#{tracker.vehicle.serieNr}" />
            </b:dataTableColumn>
            <b:dataTableColumn>
                <f:facet name="header">
                    <h:outputText value="Kies cartracker" />
                </f:facet>
                <h:form>
                    <b:commandButton action="#{tourmanager.pickCartracker(tracker)}"
                                   value="Pick car" >
                    </b:commandButton>
                </h:form>
            </b:dataTableColumn>
        </b:dataTable>
    </h:body>
</html>

pom.xml

<dependency>
    <groupId>net.bootsfaces</groupId>
    <artifactId>bootsfaces</artifactId>
    <version>1.2.0</version>
    <scope>compile</scope>
</dependency>

web.xml

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
like image 360
Guido Avatar asked Nov 07 '22 08:11

Guido


1 Answers

curiously in my case I had a similar problem, and it turns out that so many modifications and tests prove that this dependency in my pom.xml generated that the bootsfaces components were not rendered. My solution was to eliminate this dependence.

org.glassfishjavax.faces2.2.7

like image 145
jlfv Avatar answered Nov 15 '22 12:11

jlfv