Spring 为什么赢了';RichFaces 4组件是否正确渲染?

Spring 为什么赢了';RichFaces 4组件是否正确渲染?,spring,jsf,jboss,richfaces,Spring,Jsf,Jboss,Richfaces,我在JBoss EAP 6.1上使用RichFaces 4以及JSF、Spring和Spring Web流,从JBoss EAP 5.1(例如RichFaces 3.3)上的相应技术进行迁移 问题是,rich:命名空间中的任何组件或控件都会生成一些HTML,但在浏览器中呈现时,它与RichFaces showcase站点上的相应组件完全不同。看起来好像有CSS和图像文件应该与RichFaces jar文件捆绑在一起,但浏览器无法找到它们。下面是屏幕截图。 作为测试,我选择了一个简单的控件ric

我在JBoss EAP 6.1上使用RichFaces 4以及JSF、Spring和Spring Web流,从JBoss EAP 5.1(例如RichFaces 3.3)上的相应技术进行迁移

问题是,rich:命名空间中的任何组件或控件都会生成一些HTML,但在浏览器中呈现时,它与RichFaces showcase站点上的相应组件完全不同。看起来好像有CSS和图像文件应该与RichFaces jar文件捆绑在一起,但浏览器无法找到它们。下面是屏幕截图。

作为测试,我选择了一个简单的控件rich:collapsablepanel,并将showcase网站上的示例代码粘贴到应用程序的测试页面中。此时会出现可折叠面板,但与演示站点上的面板完全不同。下面是屏幕截图。

我在多个浏览器(IE、Firefox和Chrome)和多个rich:组件(例如rich:extendedDataTable、rich:tabPanel、rich:calendar)中得到了相同的结果,因此我认为这指向了库或配置问题

下面是我正在使用的库的列表

aopalliance-1.0.jar
aspectjweaver.jar
cglib-nodep-2.2.2.jar
commons-beanutils-1.8.3.jar
commons-codec-1.5.jar
commons-collections-3.2.1.jar
commons-digester-2.1.jar
commons-lang-2.6.jar
commons-logging-1.1.jar
cssparser-0.9.5.jar
guava-r09.jar
jdom.jar
log4j-1.2.16.jar
org.springframework.binding-2.3.2.RELEASE.jar
org.springframework.faces-2.3.2.RELEASE.jar
org.springframework.js-2.3.2.RELEASE.jar
org.springframework.js.resources-2.3.2.RELEASE.jar
org.springframework.webflow-2.3.2.RELEASE.jar
poi-3.8-20120326.jar
richfaces-components-api-4.3.2.Final-redhat-1.jar
richfaces-components-ui-4.3.2.Final-redhat-1.jar
richfaces-core-api-4.3.2.Final-redhat-1.jar
richfaces-core-impl-4.3.2.Final-redhat-1.jar
sac-1.3.jar
spring-aop-3.2.0.RELEASE.jar
spring-aspects-3.2.0.RELEASE.jar
spring-beans-3.2.0.RELEASE.jar
spring-context-3.2.0.RELEASE.jar
spring-context-support-3.2.0.RELEASE.jar
spring-core-3.2.0.RELEASE.jar
spring-expression-3.2.0.RELEASE.jar
spring-instrument-3.2.0.RELEASE.jar
spring-instrument-tomcat-3.2.0.RELEASE.jar
spring-jdbc-3.2.0.RELEASE.jar
spring-jms-3.2.0.RELEASE.jar
spring-orm-3.2.0.RELEASE.jar
spring-oxm-3.2.0.RELEASE.jar
spring-security-acl-3.1.3.RELEASE.jar
spring-security-aspects-3.1.3.RELEASE.jar
spring-security-cas-3.1.3.RELEASE.jar
spring-security-config-3.1.3.RELEASE.jar
spring-security-core-3.1.3.RELEASE.jar
spring-security-crypto-3.1.3.RELEASE.jar
spring-security-ldap-3.1.3.RELEASE.jar
spring-security-openid-3.1.3.RELEASE.jar
spring-security-remoting-3.1.3.RELEASE.jar
spring-security-taglibs-3.1.3.RELEASE.jar
spring-security-web-3.1.3.RELEASE.jar
spring-struts-3.2.0.RELEASE.jar
spring-test-3.2.0.RELEASE.jar
spring-tx-3.2.0.RELEASE.jar
spring-web-3.2.0.RELEASE.jar
spring-webmvc-3.2.0.RELEASE.jar
spring-webmvc-portlet-3.2.0.RELEASE.jar
这是我的web.xml,只有几个部分更改为匿名(app-servlet.xml和com.app.class)


上下文配置位置
/WEB-INF/app-servlet.xml
字符编码滤波器
org.springframework.web.filter.CharacterEncodingFilter
编码
UTF-8
强制编码
真的
字符编码滤波器
/*
org.richfaces.skin
违约
javax.faces.DEFAULT_后缀
.xhtml
javax.faces.PROJECT_阶段
发展
javax.faces.FACELETS\u刷新\u周期
1.
磁头过滤器
com.app.class
磁头过滤器
/*
springSecurityFilterChain
org.springframework.web.filter.DelegatingFilterProxy
springSecurityFilterChain
/*
org.springframework.web.context.ContextLoaderListener
SpringMVC调度程序Servlet
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
2.
SpringMVC调度程序Servlet
/弹簧/*
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
*.面孔
javax.servlet.jsp.jstl.fmt.localizationContext
资源.应用
com.sun.faces.config.ConfigureListener
我还查看了和,它们似乎是相关的,但我找不到任何信息来帮助解决我的问题


有什么建议吗?

原来是Spring配置问题。如果您使用的是Spring和/或SpringWebFlow,请在配置文件中检查以下代码。请注意,这些只是代码片段,不是完整的配置文件

webflow-config.xml

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:webflow="http://www.springframework.org/schema/webflow-config"
       xmlns:faces="http://www.springframework.org/schema/faces"
       xsi:schemaLocation="
           http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/webflow-config 
           http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
           http://www.springframework.org/schema/faces 
           http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:faces="http://www.springframework.org/schema/faces"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">

    <faces:resources />

    <!-- Needed for RichFaces! -->
    <bean name="richfacesResourceHandler" class="org.springframework.faces.webflow.JsfResourceRequestHandler" />
    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="order" value="0" />
        <property name="mappings">
            <value>
                  /rfRes/**=richfacesResourceHandler
            </value>
        </property>
    </bean>

webmvc-config.xml

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:webflow="http://www.springframework.org/schema/webflow-config"
       xmlns:faces="http://www.springframework.org/schema/faces"
       xsi:schemaLocation="
           http://www.springframework.org/schema/beans 
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/webflow-config 
           http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
           http://www.springframework.org/schema/faces 
           http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:faces="http://www.springframework.org/schema/faces"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">

    <faces:resources />

    <!-- Needed for RichFaces! -->
    <bean name="richfacesResourceHandler" class="org.springframework.faces.webflow.JsfResourceRequestHandler" />
    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="order" value="0" />
        <property name="mappings">
            <value>
                  /rfRes/**=richfacesResourceHandler
            </value>
        </property>
    </bean>

/rfRes/**=richfacesResourceHandler

你有SSCCE网页吗?它没有清晰地加载richfaces的css,那么在chrome中单击鼠标右键并检查元素以查看css是否已加载并可访问呢?免责声明:我的同事已经解决了这个问题。我只是把它贴出来,以防其他人遇到同样的问题。