index.jsp代码如下:
<jsp:forward page="index.do"></jsp:forward>
在struts-config.xml中配置如下:
<action
path="/index"
type="com.yschat.struts.action.IndexAction"
input="/index2.jsp"
/>
IndexAction.java代码如下:
package com.yschat.struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.sql.DataSource;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessages;
public class IndexAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ActionMessages message=new ActionMessages();
return mapping.getInputForward();
}
}
运行index.jsp后,不能跳转到index2.jsp页面,怎么回事?谢谢!!