primefaces中的标记日历不会显示在导航器中

时间:2014-07-20 15:23:52

标签: jsf primefaces jsf-2.2

我是jsf的初学者,当我使用标签日历时,它不会显示在导航器中,并且会出现任何错误;我使用eclipce,jsf 2,primefaces 4

这里是我的代码视图:

<?xml version="1.0" encoding="UTF-8"?>
<!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:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">

    <h:body>
    <h:form>

    <p:calendar value="#{ticket.dateCreation}" mode="inline"  />

    </h:form>
    </h:body>

    </html>

1 个答案:

答案 0 :(得分:0)

从JSF 2.2开始,您应该使用新的命名空间:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

你还应该包括

<h:head>
</h:head>

位于名称空间下方,因此Primefaces可以包含Javascript / CSS资源。

我希望您不要引用Netscape Navigator: - )

相关问题