八、动态方法的调用和使用通配符定义action
来源:互联网 发布:ppt 触发器 mac 设置 编辑:程序博客网 时间:2024/05/17 23:00
如果action中存在多个方法时,可以使用“!+方法名”调用指定方法,如下:
public class HelloAction{
public String execute(){}
public String other(){}
}
如果访问上面的action的URL路径为:/abc/hello,如果要访问other()方法,可以这样调用:
/abc/hello!other,如果不想使用动态方法调用,可以通过设置常量关闭。
也可以使用通配符定义action,如下:
<action name="hello_*" class="action.helloaction" method="{1}">
</action>
如果要访问other()方法,可以通过这样的URL访问:/abc/hello_other
public class HelloAction{
public String execute(){}
public String other(){}
}
如果访问上面的action的URL路径为:/abc/hello,如果要访问other()方法,可以这样调用:
/abc/hello!other,如果不想使用动态方法调用,可以通过设置常量关闭。
也可以使用通配符定义action,如下:
<action name="hello_*" class="action.helloaction" method="{1}">
</action>
如果要访问other()方法,可以通过这样的URL访问:/abc/hello_other
0 0
- 八、动态方法的调用和使用通配符定义action
- action动态方法调用和使用通配符定义action
- struts2中动态方法调用和使用通配符定义Action
- struts2动态方法调用和使用通配符定义action
- 动态方法调用和使用通配符定义action
- struct2动态方法调用和使用通配符定义action
- Struts2动态方法调用和使用通配符定义action
- Struts2_动态方法调用和使用通配符定义action
- struts2-10动态方法调用和使用通配符定义action
- 第11章 动态方法调用和使用通配符定义action
- struts2教程:10、动态方法调用和使用通配符定义action
- struts2学习笔记--------动态方法调用和使用通配符定义action
- 通配符和动态方法调用Action
- struts2:动态方法调用与通配符定义action
- Struts2.5动态方法调用action和使用通配符访问action
- struts2 使用通配符动态定义action
- 使用通配符定义Action
- 使用通配符定义Action
- 【3.16XJ模拟题】坦克
- MQTT学习2——基础知识
- 离散对数加密算法
- 七、为应用指定多个struts配置文件
- Sublime Text 3 常用插件以及安装方法
- 八、动态方法的调用和使用通配符定义action
- POJ 1284 Primitive Roots 已翻译
- 练习c语言
- 转战Hexo
- 【学习】彻底理解树状数组
- 【c++】编码规范及相应的配置方法
- 函数
- 终止进程的工具kill,killall,pkill和xkill
- 十、自定义类型转换器