图像广告richfaces组件未在JSF2中显示

时间:2016-03-07 19:33:18

标签: jsf-2 richfaces jboss-eap-6

我正在使用JSF 2.1,richfaces 4.5.13。 jboss eap 6.3.0服务器的最终版本。即使在登录页面中,图像和richfaces组件也不会显示。我也在使用表单身份验证。我已经尝试了很多,但我无法弄清楚这个问题。

我的web.xml,

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

<session-config>
<session-timeout>60</session-timeout>
</session-config>

<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>

<servlet>
  <servlet-name>Faces Servlet</servlet-name>
  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>/faces/*</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.jsf</url-pattern>
</servlet-mapping>

<servlet>
  <servlet-name>Resource Servlet</servlet-name>
  <servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
  <servlet-name>Resource Servlet</servlet-name>
  <url-pattern>/org.richfaces.resources/*</url-pattern>
 </servlet-mapping>

 <welcome-file-list>  
 <welcome-file>faces/index.html</welcome-file>   
 </welcome-file-list> 

<welcome-file-list>
    <welcome-file>/faces/login.xhtml</welcome-file>
</welcome-file-list>

<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
        <form-login-page>/faces/login.xhtml</form-login-page>
        <form-error-page>/faces/error.xhtml</form-error-page>
    </form-login-config>
</login-config>

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Unprotected Pages</web-resource-name>
        <url-pattern>/faces/login.xhtml</url-pattern>
        <url-pattern>/faces/logout.xhtml</url-pattern>
        <url-pattern>/layout/*</url-pattern>
        <url-pattern>/stylesheet/*</url-pattern>
        <url-pattern>/layout/*</url-pattern>
        <url-pattern>/js/*</url-pattern>
        <url-pattern>/img/*</url-pattern>
        <url-pattern>/javax.faces.resource/*</url-pattern>
        <url-pattern>/org.richfaces.resources/*</url-pattern>

        <http-method>PUT</http-method>
        <http-method>DELETE</http-method>
        <http-method>GET</http-method>
        <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
        <role-name>GLOBAL ADMIN</role-name>
    </auth-constraint>
</security-constraint>   
<security-role>
    <role-name>GLOBAL ADMIN</role-name>
</security-role>    
</web-app>

login.xhtml

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:rich="http://richfaces.org/rich"
            template="layout/template.xhtml">

<ui:define name="body">

<ui:include src="layout/errorinfo.xhtml" />

<form method="post" action="j_security_check">
    <h:panelGrid id="panel" columns="2" border="1" cellpadding="4" cellspacing="4">
        <h:inputText  name="j_username" id="j_username"/>
        <h:outputLabel for="j_username">Username </h:outputLabel>              
        <h:inputSecret name="j_password" id="j_password"/>
        <h:outputLabel for="j_password">Password</h:outputLabel>          
        <h:panelGroup>
            <input type="submit" value="Login"/>
        </h:panelGroup>
    </h:panelGrid>
</form>
</ui:define> 
</ui:composition>

有人可以帮我解决这个问题吗?

0 个答案:

没有答案