【问题标题】:JSF Navigation case not worked in IEJSF 导航案例在 IE 中不起作用
【发布时间】:2012-02-20 06:03:10
【问题描述】:

在我的示例应用程序中使用 JSF2.0 + richfaces3.3.3 + tomcat6.0.29。

我没有重定向的导航案例在 IE 中不起作用。 但其他浏览器工作正常。

当我添加 redirect 标签时,页面导航将在所有浏览器中工作。

JSF1.2,我不使用重定向,页面导航在所有浏览器中都能正常工作。

为什么 JSF2.0 需要重定向标签?

我的 jsp 文件位置 webpages/design/first.jspwebpages/design/second.jsp

faces-config.xml

....
....
 <managed-bean>        
    <managed-bean-name>First</managed-bean-name>
    <managed-bean-class>sample.First</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
</managed-bean>

<navigation-rule>        
    <from-view-id>/design/first.jsp</from-view-id>
    <navigation-case>
        <from-outcome>go_secondpage</from-outcome>
        <to-view-id>/design/second.jsp</to-view-id>

    </navigation-case>
</navigation-rule>


....

webpages/design/first.jsp

<f:view>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>First Page</title>
    </head>
    <body>

        <h:form id="sampleForm">

            <h:panelGrid cellpadding="10" cellspacing="10">

                <h:outputText value="You are in first page"/>
                <a4j:commandButton value="GO-SecondPage" action="#{First.goSecondPage}"/>

            </h:panelGrid>

        </h:form>

    </body>
</html>

First.java

package sample;
public class First
{
    public String goSecondPage()
    {
        String message = "go_secondpage";
        return message;
    }
}

webpages/design/second.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Seocnd Page</title>
</head>
<body>
    <h1>Welcome second page</h1>
</body>
</html>

帮帮我。 提前谢谢...

【问题讨论】:

    标签: tomcat jsf-2 navigation richfaces


    【解决方案1】:

    您正在使用有限支持 JSF2 检查 link 的 Richfaces 版本。删除richfaces 标记,使用纯JSF 命令按钮标记并检查,如果将richfaces 与JSF2 一起使用,请使用4.x 版。它不是 JSF 问题。另请参阅您正在根据 JSF 版本使用正确的 faces-config.xml。

    【讨论】:

      猜你喜欢
      • 2011-05-17
      • 1970-01-01
      • 1970-01-01
      • 2011-03-30
      • 2011-06-06
      • 2016-11-05
      • 2011-11-26
      • 2016-11-04
      • 1970-01-01
      相关资源
      最近更新 更多