【问题标题】:JSF - RichFaces - IE9 re render failureJSF - RichFaces - IE9 重新渲染失败
【发布时间】:2023-04-09 01:49:01
【问题描述】:

我正在使用 RichFaces 4.1.0、mojarra 2.0.2 和 apache tomcat 6.0.32 运行 Web 应用程序。 我的应用程序在除 IE9 之外的所有不同浏览器中运行良好。 它在 IE 9 中停止工作,并且不会生成任何 javascript 错误或 tomcat 日志。 只要发生 a4j 重新渲染操作,它就会失败。 由于设计限制,我无法使用元标记将 IE9 设置为兼容模式。

下面是我的代码和 web.xml:

<h:body>
<h:form>
    <rich:tabPanel switchType="client">
        <rich:tab header="Overview"> 
            <span>Total Number of Applications</span>
        </rich:tab>
        <rich:tab header="Options" onheaderclick="refreshOptions();" >
            <h:outputText value="Logging Level:" />
            <rich:select id="optionsLogLevel" 
                         value="#{optionsBean.logLevel}" 
                         required="true" 
                         requiredMessage="Logging Level is required">
                <f:selectItems value="#{optionsBean.logLevelsList}" />
            </rich:select>
        </rich:tab>
    </rich:tabPanel>
    <a4j:jsFunction name="refreshOptions"
                action="#{optionsBean.refreshOptions}"
                render="optionsLogLevel" execute="@this" />
</h:form>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 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-app_2_5.xsd">

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Production</param-value>
</context-param>
<context-param>
    <param-name>com.sun.faces.enableEarlyMissingResourceLibraryDetection</param-name>
    <param-value>true</param-value>
</context-param>
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
    <listener-class>com.mitel.bpi.webadmin.model.BPIWebAdminContextListener</listener-class>
</listener>

【问题讨论】:

  • 设计约束是什么?我建议研究一下可以帮助旧版 IE(或兼容模式下的 IE9)仍然正确显示现代 CSS 的 polyfill。
  • 在 Mojarra 中,ajax 和 IE9 存在一些问题。您可以尝试当前的 Mojarra 版本 2.1.7 吗?

标签: jsf richfaces


【解决方案1】:

您很可能会点击JAVASERVERFACES-2063,由于 jsf.js 中错误实现的浏览器检测,这会破坏 IE9 中的 ajax 通信。

升级到 Mojarra >= 2.1.7 可能会解决您的问题。升级 RichFaces,4.1.0。Final 现在已经很长了。

【讨论】: