首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Action2中的步骤通配符

2012-12-22 
Action2中的方法通配符这里的{1}表示接收前面action里通过通配符传来的值,例如你配置的是:?然后调用***/ed

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方法

??? 通配符和普通的配置具有相同的地位,可以结合使用框架的所有其他功能。

热点排行