日期:2014-05-20  浏览次数:20657 次

struts2 中<jsp:forward>转向的问题。。请高手解答!!!
index.jsp页面:
  <jsp:forward page="index.action"></jsp:forward>

在struts.xml配置如下:
  <package name="struts2" extends="struts-dafult">
  <action name="index" class="org.swp.action.IndexAction">
  <result name="SUCCESS">/index2.jsp</result>
  </action>
  </package>
在运行时出现404错误(找不到index.action),请高手帮下忙!!!!

------解决方案--------------------
断点跟下,看看进没进入IndexAction的execute方法,如过进入了,那么就看看工程的webroot下面有没有index2.jsp呀。
------解决方案--------------------

------解决方案--------------------
"index.action"是转向这个页面吗,是不是打错了,应该是"index.jsp"啊!
------解决方案--------------------
楼主把出错的404页面贴出来!~!
得看一下你的出错的页面的路径是不是有问题
------解决方案--------------------
struts 配置问题
------解决方案--------------------
<action path=“IndexAction"
type="org.swp.action.IndexAction"
parameter="method">
------解决方案--------------------
探讨
断点跟下,看看进没进入IndexAction的execute方法,如过进入了,那么就看看工程的webroot下面有没有index2.jsp呀。

------解决方案--------------------
探讨
引用:
断点跟下,看看进没进入IndexAction的execute方法,如过进入了,那么就看看工程的webroot下面有没有index2.jsp呀。


你的index。action中有没exectue的方法,
public String execute() {
return Action.SUCCESS;
}

这个方法是必须的,它说找不到index。action你在你的配置文件

<package name="struts2" extends="struts-dafult">
<action name="index" cla…

------解决方案--------------------
action path=“IndexAction" 看看?
------解决方案--------------------
还没用过2.0,呵呵.
------解决方案--------------------
<jsp:forward page="struts2/index.action"> </jsp:forward>
太久不用了,试下
最好用struts2带的例子中默认package的配法
------解决方案--------------------
struts2中好像没有这样的配置把!! 
你用的是struts1.x的把。。 
我问的是struts2.x中的怎么配置的!!
------解决方案--------------------
<action path=“IndexAction" 
type="org.swp.action.IndexAction" 
parameter="method">
------解决方案--------------------
在<jsp:forward> 里面直接用index这个试试...
------解决方案--------------------
你的配置文件里的path呢?
------解决方案--------------------
应该也没有ACTION吧,直接index试试
还有看看 你在web.xml中对 struts的配置
------解决方案--------------------
XML code
 <action name="index" class="org.swp.action.IndexAction">

------解决方案--------------------
<action path=“IndexAction" 
type="org.swp.action.IndexAction"