java.lang.NullPointerException错误,因为renderKitId =“PRIMEFACES_MOBILE”

时间:2015-06-26 01:13:39

标签: jsf mobile jsf-2 primefaces renderer

我想制作一个移动页面(移动和网络在同一个项目中)。 我做了类似的事情:

web999.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pm="http://primefaces.org/mobile"
      contentType="text/html"
      xmlns:ahm="http://java.sun.com/jsf/composite/ahm"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

   <ui:include src="/pages/default_web_template.xhtml" >
        <ui:param name="contentPage" value="/pages/com/ahm/ds/xxx/web999/ahmdsxxx99901.xhtml"/>
        <ui:param name="menuId" value="AHMDSXXX999"/>
    </ui:include>  
</f:view>

这是ahmdsxxx99901.xhtml

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<f:view xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        xmlns:pm="http://primefaces.org/mobile"
        xmlns:ahm="http://java.sun.com/jsf/composite/ahm"
        contentType="text/html"
        renderKitId="PRIMEFACES_MOBILE"
        xmlns:c="http://java.sun.com/jsp/jstl/core">
    <!-- <h:outputScript library="js" name="transaksiMobile.js" target="head" /> -->
    <h:outputScript library="js" name="jquery-ui-1.8.23.min.js" target="head" />
    <h:outputStylesheet library="css" name="maincontainer.css"  />

    <!-- <h:outputLabel value="testing broooo"/> -->
    <h:body>
        <pm:page id="customer">
            <pm:header title="Page 1"></pm:header>
            <pm:content>
                <h:form id="frm_xxx999" enctype="multipart/form-data">

                    <p:tabMenu>
                        <p:menuitem value="Customer" />
                        <p:menuitem value="Service" />
                        <p:menuitem value="Part" />
                    </p:tabMenu>
                    <pm:field>
                        <p:outputLabel for="basic" value="No. Polisi" />
                        <p:inputText id="basic" required="true"/>
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="selectOneMenu" value="Tipe Motor" />
                        <p:selectOneMenu id="selectOneMenu">
                            <f:selectItem itemLabel="Select One" itemValue="Pilih" />
                            <f:selectItem itemLabel="Option 1" itemValue="1" />
                            <f:selectItem itemLabel="Option 2" itemValue="2" />
                            <f:selectItem itemLabel="Option 3" itemValue="3" />
                        </p:selectOneMenu>
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="selectOneMenu" value="Tahun Produksi" />
                        <p:selectOneMenu id="selectOneMenu">
                            <f:selectItem itemLabel="Select One" itemValue="Pilih" />
                            <f:selectItem itemLabel="Option 1" itemValue="1" />
                            <f:selectItem itemLabel="Option 2" itemValue="2" />
                            <f:selectItem itemLabel="Option 3" itemValue="3" />
                        </p:selectOneMenu>
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="basic" value="Kilometer" />
                        <p:inputText id="basic" required="true" />
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="basic" value="Nama" />
                        <p:inputText id="basic" />
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="basic" value="Alamat" />
                        <p:inputText id="basic" />
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="basic" value="No. HP" />
                        <p:inputText id="basic" />
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="basic" value="Foto" />
                        <p:growl showDetail="true"/>
                        <p:fileUpload mode="simple" />
                        <p:commandButton value="Upload" icon="ui-icon-arrow-u" ajax="false" />
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="textarea" value="Keluhan" />
                        <p:inputTextarea id="textarea" />
                    </pm:field>
                    <br></br>
                    <br></br>
                    <br></br>
                    <pm:field>
                        <p:outputLabel for="basic" value="Saran Mekanik Terakhir" />
                        <p:inputText id="basic" />
                    </pm:field>
                </h:form>
            </pm:content>
        </pm:page>
    </h:body>>
</f:view>

此renderKitId =“PRIMEFACES_MOBILE”发出错误

  

“显示java.lang.NullPointerException”

这是堆栈跟踪:

  

java.lang.NullPointerException at   org.apache.coyote.tomcat5.CoyoteWriter.write(CoyoteWriter.java:255)     在   com.sun.faces.application.view.WriteBehindStateWriter.write(WriteBehindStateWriter.java:127)     在   com.sun.faces.renderkit.html_basic.HtmlResponseWriter.write(HtmlResponseWriter.java:666)     在   org.primefaces.mobile.component.page.PageRenderer.encodeBegin(PageRenderer.java:64)     在   javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:820)     在javax.faces.component.UIComponent.encodeAll(UIComponent.java:1755)     在javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)     在javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)     在javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)     在   com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)     在   com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)     在   com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)     在com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)at   com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)     在javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)at   org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)     在   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)     在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)     在   org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)     在   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)     在   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)     在   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)     在   org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)     在   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)     在   org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)     在   org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)     在com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)at   com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)     在   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)     在   org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)     在   org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)     在   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)     在   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)     在   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)     在   org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)     在   org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)     在   org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)     在   org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)     在   org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)     在   com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)     在   com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)     在   com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)     在   com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)     在   com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)     在   com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)     在   com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)     在   com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)   |#]

您能告诉我它是如何发生的以及解决方案吗?谢谢

0 个答案:

没有答案