日期:2014-05-17  浏览次数:20727 次

struts1.x中如何不通过输入界面,直接输入url就映射到action?并且没有ActionForm
就是比如是直接输入http://www.baidu.com/index.do就映射到IndexAction然后就进行一些处理然后跳到输出页面!没有进行ActionForm的提交过程
struts struts1 action actionform

------解决方案--------------------
你不走ActionForm  怎么获取数据??
------解决方案--------------------
那样的话就只是单纯的跳转了。
------解决方案--------------------
你直接输入那个url当然是直接到后台action去了,你把这个action写在form的action中,就会提交form了
------解决方案--------------------
action中方法返回  return "success"
<action name="index" class="/proj/action/IndexAction">/
   <result name="success" type="redirect">/index.jsp</result>
</action>
就是跳到action马上就转发出去