Primefaces应用程序不起作用

时间:2017-02-03 08:59:30

标签: java maven jsf primefaces jsf-2

您好我使用的是primefaces 5.3版本和jsf 2.2和java 1.8,我有一个带有primefaces数据表延迟加载的页面,但它在本地机器上工作但在我部署在远程机器时最终会出错。我有任何错误配置。

的pom.xml

while getopts b:a: option
do
    case "${option}"
    in
        b) MERGE_BRANCH=${OPTARG};;
        a) ACTION=${OPTARG};;
    esac
done

if "$1" = ""; then
    exit
fi

echo "$1"
echo "$MERGE_BRANCH"
echo "$ACTION"

的index.xhtml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>almightyenterprises</groupId>
    <artifactId>almightyenterprises</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <warSourceDirectory>WebContent</warSourceDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.7.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-c3p0</artifactId>
            <version>4.3.8.Final</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.34</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.14</version>
        </dependency>
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.14</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.2.14</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.5.4</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.faces</artifactId>
            <version>2.2.9</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>5.3</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces.extensions</groupId>
            <artifactId>all-themes</artifactId>
            <version>1.0.8</version>
        </dependency>
        <dependency>
            <groupId>commons-net</groupId>
            <artifactId>commons-net</artifactId>
            <version>3.5</version>
        </dependency>
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
            <version>0.1.51</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.3.1</version>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.9</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.0</version>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>1.17</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-servlet</artifactId>
            <version>1.17</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-multipart</artifactId>
            <version>1.17</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20090211</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.15</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.15</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.ez-vcard</groupId>
            <artifactId>ez-vcard</artifactId>
            <version>0.10.1</version>
        </dependency>
    </dependencies>
</project>

登录

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:hx="http://xmlns.jcp.org/jsf/passthrough"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:jsf="http://xmlns.jcp.org/jsf" xmlns:p="http://primefaces.org/ui">
<h:head>
    <meta content="text/html; charset=utf-8" http-equiv="content-type" />
    <title>SMS Dasboard</title>
    <link rel="shortcut icon" href="../assets/images/favicon.ico" />
    <!-- Bootstrap core CSS     -->
    <link href="../assets/css/bootstrap.min.css" rel="stylesheet" />

    <!-- Animation library for notifications   -->
    <link href="../assets/css/animate.min.css" rel="stylesheet" />
    <link href="../assets/css/style.css" rel="stylesheet" />
</h:head>

<h:body>
    <div id="wrapper">

        <!-- Top -->
        <div class="container">
            <div class="row">
                <div class="top">
                    <div class="col-lg-6">
                        <a href="index.xhtml"><img src="../assets/images/logo.png"
                            class="brand" alt="" /></a>
                    </div>
                    <div class="col-lg-6 pull-right">
                        <div class="links">
                            <ul>
                                <li><a href="#"><img
                                        src="../assets/images/settings.png" alt="" /> Settings</a></li>
                                <li><p:inputText name="" type="button"
                                        value="SMS Balance : 89,000"
                                        styleClass="btn balancebtn btn-default" /></li>
                                <li><a href="#"><img src="../assets/images/logout.png"
                                        alt=""></img> Logout</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- Top End -->

        <!--   Main End  -->

        <section class="mainsec">
        <div class="container">
            <div class="row">

                <!--  Sidebar  -->
                <div class="col-lg-2">
                    <div class="sidebar">
                        <div class="headings pink">
                            <h3>latest activities</h3>
                        </div>
                        <div class="contentsec">
                            <p>Added 200 new items for 2 groups, Added 200 new items for
                                2 groups, Added 200 new items for 2 groups</p>
                            <div class="date">
                                <img src="../assets/images/date.png" alt="" /> 19.01.2017
                            </div>
                            <div class="time">
                                <img src="../assets/images/time.png" alt="" /> 11.12
                            </div>
                            <div class="border"></div>
                        </div>

                        <div class="contentsec" style="opacity: 0.3;">
                            <p>Added 200 new items for 2 groups, Added 200 new items for
                                2 groups, Added 200 new items for 2 groups</p>
                            <div class="date">
                                <img src="../assets/images/date.png" alt="" /> 18.01.2017
                            </div>
                            <div class="time">
                                <img src="../assets/images/time.png" alt="" /> 12.12
                            </div>
                            <div class="border"></div>
                        </div>

                        <div class="contentsec" style="opacity: 0.3;">
                            <p>Added 200 new items for 2 groups, Added 200 new items for
                                2 groups, Added 200 new items for 2 groups</p>
                            <div class="date">
                                <img src="../assets/images/date.png" alt="" /> 17.01.2017
                            </div>
                            <div class="time">
                                <img src="../assets/images/time.png" alt="" /> 09.12
                            </div>
                            <div class="border"></div>
                        </div>

                    </div>
                </div>

                <!--  Sidebar End -->

                <!--  CenterSec  -->

                <div class="col-lg-7">
                    <div class="centersec">
                        <div class="collapse" id="collapseExample">
                            <div class="card-block">
                                <h3>Add Items</h3>
                                <p>
                                    <h:form styleClass="form-group" id="uppperForm">
                                        <label>Name</label>
                                        <p:inputText styleClass="col-lg-12 input-group" />
                                        <label>Email</label>
                                        <input class="col-lg-12 input-group" />
                                        <label>Phone No</label>
                                        <p:inputText styleClass="col-lg-12 input-group" />
                                        <label>Group</label>
                                        <div class="clearfix"></div>
                                        <p:inputText styleClass="col-lg-9 input-group input1" />
                                        <p:inputText name="" type="button" value="+ Add"
                                            styleClass="col-lg-2 btn1" />
                                        <p:inputText name="" type="button" value="Add Contact"
                                            styleClass="btn editbtn btn-default" />
                                    </h:form>
                                </p>
                            </div>
                        </div>


                        <div class="additems">
                            <div class="headings yellow">
                                <h3>
                                    <a data-toggle="collapse" href="#collapseExample"
                                        aria-expanded="false" aria-controls="collapseExample">Add
                                        Items</a>
                                </h3>
                                <span>1612</span>
                            </div>
                            <div class="filter">
                                <img src="../assets/images/items.png" alt="" />
                            </div>
                            <div class="listing">
                                <h:form id="itemsListingForm">
                                    <p:dataTable rows="20" lazy="true"
                                        paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                        rowKey="#{item.itemCode}" id="itemDetailTable"
                                        widgetVar="itemDetailTablewVar" scrollRows="20"
                                        liveScroll="true" scrollHeight="430" scrollable="true"
                                        value="#{productBean.jobLazyDataItemList}" var="item"
                                        filteredValue="#{productBean.itemModelList}"
                                        selectionMode="multiple" editable="true" editMode="cell"
                                        selection="#{productBean.selectedItemList}">
                                        <f:facet name="header">
                                            <p:outputPanel>
                                                <p:inputText id="globalFilter" styleClass="col-lg-12 search"
                                                    onkeyup="PF('itemDetailTablewVar').filter()"
                                                    placeholder="Search" />

                                            </p:outputPanel>
                                        </f:facet>
                                        <p:ajax event="cellEdit"
                                            listener="#{productController.onCellEditTableComplete(item)}"
                                            update="@([id$=itemDetailTable])" />
                                        <p:column headerText="Item Code" filterBy="#{item.itemCode}"
                                            styleClass="col-lg-2" filterStyle="display:none;">
                                            <h:outputText value="#{item.itemCode}"
                                                style="font-weight: bold" />
                                        </p:column>
                                        <p:column headerText="Item Name" filterBy="#{item.itemName}"
                                            styleClass="col-lg-8" filterStyle="display:none;">
                                            <h:outputText value="#{item.itemName}" />
                                        </p:column>
                                        <p:column headerText="Item Price" filterBy="#{item.itemPrice}"
                                            styleClass="col-lg-2" filterStyle="display:none;">
                                            <p:cellEditor>
                                                <f:facet name="output">
                                                    <h:outputText value="#{item.itemPrice}" />
                                                </f:facet>
                                                <f:facet name="input">
                                                    <p:inputText value="#{item.itemPrice}" style="width:96%" />
                                                </f:facet>
                                            </p:cellEditor>
                                        </p:column>
                                    </p:dataTable>

                                </h:form>
                            </div>
                        </div>

                        <div class="addgroup">
                            <div class="headings green">
                                <h3>Add Contact</h3>
                                <span>798</span>
                            </div>

                            <h:form id="contactListForm">
                                <div class="filter">
                                    <img src="../assets/images/groups.png" alt="" />
                                    <p:selectOneMenu value="#{productBean.selectedGroup}"
                                        styleClass="select pull-right">
                                        <f:selectItem itemLabel="Select" itemValue=""
                                            noSelectionOption="true"></f:selectItem>
                                        <f:selectItems value="#{productBean.contactGroups}"
                                            var="group" itemLabel="#{group.groupName}"
                                            itemValue="#{group.groupName}"></f:selectItems>
                                        <p:ajax listener="#{productController.filterContact}"
                                            event="change" update="contactListForm" />
                                    </p:selectOneMenu>
                                </div>
                                <div class="listing">
                                    <p:dataTable rows="20" lazy="true"
                                        paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                                        rowKey="#{contact.contactId}" id="contactDetailTable"
                                        widgetVar="contactDetailTablewVar" scrollRows="20"
                                        liveScroll="true" scrollHeight="430" scrollable="true"
                                        value="#{productBean.jobLazyDataContactList}" var="contact"
                                        filteredValue="#{productBean.contactModelList}"
                                        selectionMode="multiple" editable="true" editMode="cell"
                                        selection="#{productBean.selectedContactList}">
                                        <f:facet name="header">
                                            <p:outputPanel>
                                                <p:inputText id="globalFilter" styleClass="col-lg-12 search"
                                                    onkeyup="PF('contactDetailTablewVar').filter()"
                                                    placeholder="Search" />
                                            </p:outputPanel>
                                        </f:facet>
                                        <p:column headerText="Contact Name"
                                            filterBy="#{contact.contactFirstName}"
                                            filterStyle="display:none;">
                                            <h:outputText value="#{contact.contactFirstName}" />
                                            <h:outputText value="#{contact.contactSecondName}" />
                                        </p:column>
                                        <p:column headerText="Contact Number"
                                            filterBy="#{contact.contactMobile}"
                                            filterStyle="display:none;">
                                            <h:outputText value="#{contact.contactMobile}" />
                                        </p:column>
                                    </p:dataTable>
                                </div>
                            </h:form>
                        </div>
                    </div>
                </div>

                <!--  CenterSec End -->

                <!--  RighrSec  -->

                <div class="col-lg-3">
                    <div class="rightsec">
                        <textarea name="Type Your Message Here..." cols="" rows="8"
                            class="col-lg-12" placeholder="Type Your Message Here..."></textarea>
                        <p>maximum characters : 200</p>
                        <textarea name="Type Your Message Here..." cols="" rows="14"
                            class="col-lg-12" placeholder="Preview..."></textarea>
                        <input name="" type="button" value="Update"
                            class="btn updatebtn btn-default pull-right" />
                    </div>
                </div>

                <!--  RighrSec End  -->

            </div>
        </div>
        </section>

        <!--   Main End  -->

        <!--   Footer   -->

        <footer>
        <div class="col-lg-12">
            <p>&copy; Company Name. 2017</p>
        </div>

        </footer>
        <!--   Footer End  -->
    </div>


    <!--   Core JS Files   -->
    <!-- <script src="../assets/js/jquery-1.10.2.js" type="text/javascript"></script>
    <script src="../assets/js/bootstrap.min.js" type="text/javascript"></script> -->
</h:body>
</html>

1 个答案:

答案 0 :(得分:2)

看起来我和Primeface与javax.faces之间的版本不匹配。你能升级到primeface 6吗?你的5.3不知道 ResourceUtils#getComponentResources 。这有点难以察觉,因为primeface在他们的javadoc中使用@ since-Annotation;)