请教struts问题

yschat2012 yschat2012 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我是用myeclipse创建的struts1.2的,然后建立了index.jsp和index2.jsp两个文件
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页面,怎么回事?谢谢!!
...全文
评论 5
收藏 已收藏
分享
返回顶部
yschat2012
Eclipse 58,439 成员 49,457 内容