tomcat - JSF 导航案例在 IE 中不起作用

标签 tomcat jsf-2 navigation richfaces

在我的示例应用程序中使用 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>

帮帮我。 提前致谢...

最佳答案

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

关于tomcat - JSF 导航案例在 IE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9030075/

相关文章:

jsf - 如何将 selectManyCheckbox 中选择的数据存储到不同的对象中?

tomcat - CloseNowException : This stream is not writeable

c# - HttpWebRequest 和 Tomcat

hibernate - 为 tomcat 配置 hibernate JNDI 的挑战

java - 如何限制每秒的网络请求以避免垃圾邮件和拒绝服务

html - 基于百分比宽度的水平导航

java - h :selectOneRadio HTML output for jsf 1. 1 对 2.0

java - JSF访问bean类中的html元素值

html - 可调整大小的导航栏

html - css 下拉菜单只显示最后一个列表项