JSF PrimeFaces空白(空)页面

时间:2015-02-21 14:37:53

标签: jsf jaas

我有PrimeFaces 5和bootstrap主题的问题。我使用wildfly服务器,ejb 3.2,JSF 2.2 + PrimeFaces 5与bootstrap主题。 我正在尝试做简单的登录页面。

我的登录页面:

<h:head>
    <title>Login Form</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <h:outputStylesheet library="primefaces-bootstrap" />
</h:head>

<h:body>
<h:form id="login" onsubmit="action='j_security_check';" prependId="false">
    <h:panelGrid columns="2">
        <p:outputLabel for="j_username" value="Username" />
        <p:inputText id="j_username" />
        <p:outputLabel for="j_password" value="Password" />
        <p:password id="j_password" />
        <p:commandButton id="submit" value="Login" ajax="false"/>
    </h:panelGrid>
</h:form>
</h:body>
</html>

不幸的是,我的网络浏览器上没有显示。 你能告诉我是什么原因吗?

Login page

1 个答案:

答案 0 :(得分:0)

我在web.xml文件中更改了url模式:

从:

   <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*xhtml</url-pattern>
    </servlet-mapping>

为:

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>/faces/login.xhtml</welcome-file>
</welcome-file-list>

不行。