配置处理结果---struts2学习笔记
2012-07-19 23:31
477 查看
<action name="login" class="lee.LoginAction">
<result name="success" type="dispatcher"> //type结果类型有chain,dispatcher,redirect..等
<param name="location">/thank.jsp</param> //视图资源
<param name="charset">GBK</param> //编码方式
</result>
</action>
重点:Action属性值决定物理视图资源
<action name="save" class="lee.LoginAction">
<result type="redirect">edit.action?skillName=${currentSkill.name}</result> //使用OGNL表达式来指定视图资源
</action>
对于上面的表达式语法,在对应的Action实例里应该包含currentSkill属性,且currentSkill必须包含name属性,否则表达式的值为null
使用PreResultListener可以在Action完成控制处理后,系统转入实际的物理视图之前被回调
例:
ActionInvocation in = ActionContext.getContext().getActionInvocation();
in.addPreResultListener(new PreResultListener(){
//重写方法beforeResult
}
)
<result name="success" type="dispatcher"> //type结果类型有chain,dispatcher,redirect..等
<param name="location">/thank.jsp</param> //视图资源
<param name="charset">GBK</param> //编码方式
</result>
</action>
重点:Action属性值决定物理视图资源
<action name="save" class="lee.LoginAction">
<result type="redirect">edit.action?skillName=${currentSkill.name}</result> //使用OGNL表达式来指定视图资源
</action>
对于上面的表达式语法,在对应的Action实例里应该包含currentSkill属性,且currentSkill必须包含name属性,否则表达式的值为null
使用PreResultListener可以在Action完成控制处理后,系统转入实际的物理视图之前被回调
例:
ActionInvocation in = ActionContext.getContext().getActionInvocation();
in.addPreResultListener(new PreResultListener(){
//重写方法beforeResult
}
)
相关文章推荐
- 【学习笔记】Struts2之配置处理结果
- struts2系列学习笔记(6)---------------Action的结果处理
- struts2系列学习笔记(7)---------------其它形式的结果处理
- struts2学习之---配置处理结果
- day27_struts2のPPT学习4——04 配置处理结果.ppt
- [原创]java WEB学习笔记69:Struts2 学习之路-- 消息处理与国际化,概述,配置国际资源文件,访问国际化消息,通过超链接切换语言
- Struts2学习笔记之struts.xml配置常量和Action处理流程
- Struts2学习笔记之struts.xml配置常量和Action处理流程
- Struts2笔记――3.配置处理结果
- Struts2中配置处理结果及异常处理
- Struts2学习笔记之与struts.xml配置和Action有关的属性
- struts2系列学习笔记(4)---------------Action的多样化配置之二
- struts2学习笔记 配置action
- struts2 学习笔记(一)——配置文件
- Struts2 学习笔记——struts.xml文件之Bean的配置
- struts2 学习笔记之 struts.xml 配置解析
- [Struts2官方指南的个人学习和翻译] Struts2的配置元素-请求处理元素
- struts2学习笔记 -- day02 struts2主配置文件详解
- (学习笔记)spring框架入门之配置bean(处理属性中有集合的情况)
- struts2学习笔记--struts.xml配置文件详解