struts1与struts2

strtus1: 

input="/input.jsp" --表示出错时进入的页面
 ①parameter="method" paramether 是要执行的方法
 ②path="/reg" 表示要执行的action
 ③type="com.test.action.RegAction" 表示具体的要执行的action类
 ④<forward name="success".......> 表示根据具体action类返回的字符串选择进入的页面
 在com.test.action.RegAction 要继承DispatchAction
 ⑤通过name来配置处理表单的类
 ⑥set入表单以后需要在action中处理ActionForm form 。

struts2:(与strtus1相比)

 method 等同于 parameter  //在struts2中配置action的时候可以不写method,而直接在页面调教的时候写入需要处理的method

   name   等同于 Path    //这里的name与struts1完全不同,因为struts2中不用我们关注表单的注入了也就是不用关注ActionForm了

   class   等同于type

   result   等同于 ④<forward name="success".......>

  * struts2 注入的表单直接压入栈中,所以可以直接访问。

原文地址:https://www.cnblogs.com/yanjunwu/p/2682256.html