struts2的action的自定义方法和它的验证方法
来源:互联网 发布:cfcmd透视源码 编辑:程序博客网 时间:2024/05/20 05:28
若struts.xml中没有对一个action from(url)设定method属性,默认情况下会执行action中的validate方法,再执行excute方法。
但我们可对action设定多个方法,让其适用于多个url,方法如下。
<action name="register" class="com.test.action.RegisterAction" method="test">
<result name="success">/success.jsp</result>
<result name="input">/register2.jsp</result>
</action>
此时就会执行action中的test方法。而且还可对test方法来添加一个validate方法,其方法名为validateTest。此方法只对register这个url进行验证。但还会继续执行validate方法。
此时这个action中的执行顺序为:
1. 类型转换。
2. validatetest。不管类型转换时有没有错误都会执行此验证方法。
3. validate。不管validatetest验证方法中有没有发生error此方法都会执行。
4. test方法。若fieldError和actionError中都没有错误的话,再执行此方法。若有任何error发生的话,就返回input的页面。
5. 若没有自定义方法的话,才会执行excute方法。
- struts2的action的自定义方法和它的验证方法
- struts2自定义的Action方法
- Action的自定义方法
- Struts2的方法验证
- Struts2的动态调用Action方法和默认Action
- Struts2的action配置方法
- Struts2的Action方法调用
- struts2 action跳转action 的配置方法
- struts2 action 配置方法 &&struts2的配置文件
- Struts2 方法验证的XML
- Struts2-Action-4-系列问题(路径、调用Action的自定义方法、通配符)
- Struts2中Action接收参数的方法
- Struts2 action的扩展名修改方法
- Struts2中Action接收参数的方法
- 改变struts2中action后缀的方法
- Struts2中Action接收参数的方法
- Struts2调用action中指定的方法
- struts2的action中方法重复执行
- 教你使用Anti ARP Sniffer查找ARP攻击者
- java事件详解
- 逻辑数据流图与物理数据流图的差别
- 学习总结: C++ 模板 (thinking in C++)
- (7)序列化与压缩
- struts2的action的自定义方法和它的验证方法
- Mysql数据提取器
- dajiahao
- ubuntu9.04 PPA安装Ibus-pinyin笔记(转载)
- 数据库设计规范
- Download Media Player Classic Home Cinema
- 用CString作为Key使用CMap
- .NET4.0并行计算技术基础(2)
- 中小型企业局域网设计