Action2中的方法通配符
这里的{1}表示接收前面action里通过通配符传来的值,例如你配置的是:
?
然后调用***/editCrud.action,则method里获得的值是edit,将会调用这个action里面的 edit方法
附:
Action中的方法通配符
??? 有些时候对Action中方法的调用满足一定的规律,例如edit Action对应edit方法,delete Action对应 delete方法,这个时候我们可以使用方法通配符,例如:
<action name="*Crud" method="{1}"> 这时,editCrud Action的引用将调用edit方法,同理,deleteCrud Action的引用将调用delete 方法。
??? 另外一种比较常用的方式是使用下划线分割,例如:
<action name="Crud_*" method="{1}">
??? 这样当遇到如下调用的时候可以找到对应的方法。
"action=Crud_input"?? =>?? input方法
"action=Crud_delete" =>?? delete方法
??? 通配符和普通的配置具有相同的地位,可以结合使用框架的所有其他功能。