我对 JSF 1.1 有疑问(恐龙,我知道)
所以有两个页面 - index.jsp 和 test.jsp 我想在单击“创建”按钮后从 index.jsp 重定向到 test.jsp
但什么也没发生:/
ps,一般来说,我如何记录那里的东西,知道甚至没有点击事件的日志!这太糟糕了
索引.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%-- jsf:pagecode language="java" location="/src/pagecode/Index.java" --%><%-- /jsf:pagecode --%>
<%@page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<html>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="GENERATOR" content="IBM WebSphere Integration Developer 6.2">
<link rel="stylesheet" type="text/css" title="Style"
href="theme/stylesheet.css">
</head>
<f:view>
<body>
<h:panelGrid columns="1" width="12%" cellpadding="10" rendered="true">
<h:commandButton value="Create" action="#{Controller.create}" />
</h:panelGrid>
</body>
</f:view>
</html>
控制器.java
public class Controller extends PageCodeBase {
public String create() {
return "success";
}
}
面孔-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>Controller</managed-bean-name>
<managed-bean-class>pagecode.Controller</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<display-name>index</display-name>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/test.jsp</to-view-id>
<redirect />
</navigation-case>
</navigation-rule>
</faces-config>
web.xml
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>test.jsp</welcome-file>
</welcome-file-list>