【发布时间】:2015-02-13 05:48:28
【问题描述】:
我的 index.jsp 是
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>HOME</title>
</head>
<body>
Hi you are in index.jsp page
<s:action name="error" executeResult="true"></s:action>
</body>
</html>
我的错误动作类是
public class error extends ActionSupport {
public String execute() throws Exception {
System.out.println("in error action.........");
return SUCCESS;
}
}
我的 struts.xml
<action name="error" class="action.error">
<result name="success" type="redirect">
<param name="location">/Login.jsp</param>
</result>
</action>
当我点击 index.jsp 页面时,我想重定向到 Login.jsp。但每次我点击 index.jsp 时,我都会回到我的 index.jsp 页面,但这次它是空白的。它将在打印“错误操作............”时采取行动。但它没有重定向到 Login.jsp
我做错了什么?
【问题讨论】: