用struts报错,不知道是什么意思 return(map.findForward("HelloWorld_1"));这里是对应你的struts配置文件的name属性,应该改成return(map.findForward("Hello_1"));而不应该是HelloWorld_1(HelloWorld_1.jsp),希望能帮到你!! 祝你在java路上越走越远!!!!!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public class HelloAction extends Action { public ActionForward execute(ActionMapping map,ActionForm form, HttpServletRequest request,HttpServletResponse response)throws Exception{ String para=(String)request.getParameter("place"); String target="Hello_2"; if(para.equals("1")){ target="Hello_1"; } return map.findForward(target); } 应该改成: public class HelloAction extends Action { public ActionForward execute(ActionMapping map,ActionForm form, HttpServletRequest request,HttpServletResponse response)throws Exception{ String para=(String)request.getParameter("place"); String target="Hello_2"; if(para.equals("1")){ target="Hello_1"; } return map.findForward(target); } 直观的说就是:return(map.findForward("HelloWorld_1"));是对应你的struts配置文件的name属性,应该改成return(map.findForward("Hello_1")); 希望帮到你!!! 谢谢,我改了,重新启动,还是报跟刚才一样的错误,不知道是不是那些xml文件有问题? 按hubing2008(曾经沧海难为水,除却巫山不是云(☆☆☆☆)) 的修改然后<action path="/HelloWorld" type="hello.HelloAction" scope="request" validate="true"> <forward name="Hello_1" path="/HelloWorld_1.jsp"/> <forward name="Hello_2" path="/HelloWorld_2.jsp"/> </action>这里面加上name的属性 [求助] - [ssh struts2+spring 报错][附带配置文件] 求解三角形的内切圆和外接圆作图 ws部署weblogic9,上传文件出错 james邮件服务器盗用问题 怎样实现数据库表的某一个字段被更新时,为保持字段的唯一性,其它行的该字段也自动更新 JB哪个版本好用啊? 开发介绍公司情况基于触摸屏的软件,怎么实现接口 局域网内类似QQ的聊天程序,求教如何实现 java读取xml文件的几个问题!请关注 cmp问题——能插入,但不能查询!!! 如何获得一个输入筐里面鼠标选中区域的值 关于fop的问题
public ActionForward execute(ActionMapping map,ActionForm form,
HttpServletRequest request,HttpServletResponse response)throws Exception{
String para=(String)request.getParameter("place"); String target="Hello_2";
if(para.equals("1")){
target="Hello_1";
} return map.findForward(target);
}
public class HelloAction extends Action {
public ActionForward execute(ActionMapping map,ActionForm form,
HttpServletRequest request,HttpServletResponse response)throws Exception{
String para=(String)request.getParameter("place"); String target="Hello_2";
if(para.equals("1")){
target="Hello_1";
} return map.findForward(target);
}
return(map.findForward("HelloWorld_1"));是对应你的struts配置文件的name属性,应该改成return(map.findForward("Hello_1")); 希望帮到你!!!
然后
<action path="/HelloWorld"
type="hello.HelloAction"
scope="request"
validate="true">
<forward name="Hello_1" path="/HelloWorld_1.jsp"/>
<forward name="Hello_2" path="/HelloWorld_2.jsp"/> </action>
这里面加上name的属性