Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf PrimeFaces Mobile-NullPointerException_Jsf_Primefaces_Primefaces Mobile - Fatal编程技术网

Jsf PrimeFaces Mobile-NullPointerException

Jsf PrimeFaces Mobile-NullPointerException,jsf,primefaces,primefaces-mobile,Jsf,Primefaces,Primefaces Mobile,我用PrimeFaces写了一页,效果不错。 然后我尝试添加PrimeFaces Mobile: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="

我用PrimeFaces写了一页,效果不错。 然后我尝试添加PrimeFaces Mobile:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pm="http://primefaces.org/mobile">
<f:view renderKitId="PRIMEFACES_MOBILE"/>
请尝试以下代码:

 <html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:p="http://primefaces.org/ui"
  xmlns:pm="http://primefaces.org/mobile">
  <f:view renderKitId="PRIMEFACES_MOBILE" contentType="text/html" />
在faces-config.xml中:

 <?xml version='1.0' encoding='UTF-8'?>
    <faces-config version="2.0"
              xmlns="http://java.sun.com/xml/ns/javaee" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
              http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">

    <application>
        <resource-bundle>
            <base-name>/Bundle</base-name>
            <var>bundle</var>
        </resource-bundle>   

        <navigation-handler>
            org.primefaces.mobile.application.MobileNavigationHandler
        </navigation-handler>
    </application>

    </faces-config>

您是否使用带有pm:page标签的导航?是否可以发布stacktrace?这是一个单页应用程序。我将发布stacktrace。您使用的是哪个PrimeFaces版本?如果您正在开发纯移动应用程序,请尝试在faces-config.xml中定义移动渲染工具包,而不是在每个页面中。您可以在PrimeFaces文档中找到相关帮助。也许这会有帮助。请共享整个xhtml页面
 <?xml version='1.0' encoding='UTF-8'?>
    <faces-config version="2.0"
              xmlns="http://java.sun.com/xml/ns/javaee" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
              http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">

    <application>
        <resource-bundle>
            <base-name>/Bundle</base-name>
            <var>bundle</var>
        </resource-bundle>   

        <navigation-handler>
            org.primefaces.mobile.application.MobileNavigationHandler
        </navigation-handler>
    </application>

    </faces-config>