[color=green][size=large]关于Struts2 API中InputConfig内methodName和resultName的使用方法[/size][/color]
对于@InputConfig中methodName和resultName的区别很是迷惑.最后在API中找到答案了,通过做实验终于了之.
(1).Marks a action method that if it's not validated by Validationlnterceptor then execute input method or input result.
Annotation usage:The InputConfig annotation can be applied at method level.
Annotation parameters:
Parameter Required Default Notes
methodName no (2).execute this method if specific
resultName no (3).return this result if methodName not specific
(1).当验证方法没有通过时,改变默认返回的input视图
(2).methodName=====>执行指定方法
(3).resultName=====>返回result如果methodName没有指定
[b][size=x-large]Eg:[/size][/b]
[size=large][color=red] @InputConfig(methodName="Tqtest",resultName="resultTest")
@InputConfig(methodName="Tqtest",resultName="resultTest") 的作用是改变默认返回的input视图 API中可查
resultName只有在methodName没写如@InputConfig(resultName="resultTest") 时才起做用[/color][/size]
对于@InputConfig中methodName和resultName的区别很是迷惑.最后在API中找到答案了,通过做实验终于了之.
(1).Marks a action method that if it's not validated by Validationlnterceptor then execute input method or input result.
Annotation usage:The InputConfig annotation can be applied at method level.
Annotation parameters:
Parameter Required Default Notes
methodName no (2).execute this method if specific
resultName no (3).return this result if methodName not specific
(1).当验证方法没有通过时,改变默认返回的input视图
(2).methodName=====>执行指定方法
(3).resultName=====>返回result如果methodName没有指定
[b][size=x-large]Eg:[/size][/b]
[size=large][color=red] @InputConfig(methodName="Tqtest",resultName="resultTest")
@InputConfig(methodName="Tqtest",resultName="resultTest") 的作用是改变默认返回的input视图 API中可查
resultName只有在methodName没写如@InputConfig(resultName="resultTest") 时才起做用[/color][/size]
本文详细解析了Struts2API中InputConfig注解中methodName和resultName参数的作用,通过实验揭示了它们的区别及用法。重点介绍了如何通过这两个参数改变默认返回的input视图,并提供了实例代码演示。
6567

被折叠的 条评论
为什么被折叠?



