struts1 <action path="/*" parameter="{1}"> 中的parameter="{1}"是什么意思呢,小白求解。。

解决方案 »

  1.   

    通配符。 {1} 就是 * 的值。比如 你提交的是 add.do 那么这句话就等价于<action path="/add" parameter="add"> 
      

  2.   

    <action>的parameter属性是给DispatchAction使用的,你的类要继承DispatchAction类,而不是普通的Action,Action只会执行execute方法,DispatchAction会根据parameter的值执行特定的方法,注意parameter的值不要设置为execute,也不要覆盖DispatchAction中的execute(),因为DispatchAction继承于Action,它的execute会首先执行,在execute()方法中取出parameter的值,通过java反射调用指定的方法
      

  3.   

    补上来源
    http://www.iteye.com/problems/72993
      

  4.   

    其实这个parameter也可以不写的,只要有path就ok