Hibernate Result类型应用
2011-06-17 20:07
232 查看
Result类型 是在Action执行完,一个结果返回后决定发生什么事的类。开发者可以自由的根据他们的应用和环境的需要创建自己的Result类型。例如在WebWork2中,Servlet和Velocity结果类型已经被创建用来显示web应用程序的画面。
注意: 所有的webwork内建的Result类型都实现了com.opensymphony.xwork.Result接口. 这个接口是所有action执行结果的通用接口,不管这个结果是用来显示一个网页还是产生一个email,发送一个JMS消息,等.
Result类型配置中定义了一些类,把它们映射为action配置中可以引用的名字. 也就是为这些类创建便于记忆的键-值对.
Webwork提供了一些com.opensymphony.xwork.Result接口的实现来使你的action可以容易的用户交互.这些Result类型包括:
Chain Result - 用于 Action Chaining
Dispatcher Result - 用于 JSP 整合
FreeMarker Result - 用于 FreeMarker 整合
HttpHeader Result - 用于控制特殊的HTTP行为
JasperReports Result - 用于 JasperReports 整合
Redirect Result - 用于直接跳转到例外的URL
Redirect Action Result - 用于直接跳转到另外的action
Stream Result - 用于向浏览器返回一个InputStream (一般用于文件下载)
Velocity Result - 用于 Velocity 整合
XSL Result - 用于 XML/XSLT 整合
PlainText Result - 用于显示某个页面的原始的文本 (例如 jsp, html 等)
注意: 所有的webwork内建的Result类型都实现了com.opensymphony.xwork.Result接口. 这个接口是所有action执行结果的通用接口,不管这个结果是用来显示一个网页还是产生一个email,发送一个JMS消息,等.
Result类型配置中定义了一些类,把它们映射为action配置中可以引用的名字. 也就是为这些类创建便于记忆的键-值对.
<result-types> <result-type name="dispatcher" class="com.opensymphony.webwork.dispatcher.ServletDispatcherResult" default="true"/> <result-type name="redirect" class="com.opensymphony.webwork.dispatcher.ServletRedirectResult"/> <result-type name="velocity" class="com.opensymphony.webwork.dispatcher.VelocityResult"/> <result-type name="chain" class="com.opensymphony.xwork.ActionChainResult"/> <result-type name="xslt" class="com.opensymphony.webwork.views.xslt.XSLTResult"/> <result-type name="jasper" class="com.opensymphony.webwork.views.jasperreports.JasperReportsResult"/> <result-type name="freemarker" class="com.opensymphony.webwork.views.freemarker.FreemarkerResult"/> <result-type name="httpheader" class="com.opensymphony.webwork.dispatcher.HttpHeaderResult"/> <result-type name="stream" class="com.opensymphony.webwork.dispatcher.StreamResult"/> <result-type name="plaintext" class="com.opensymphony.webwork.dispatcher.PlainTextResult" /> </result-types>
Webwork提供了一些com.opensymphony.xwork.Result接口的实现来使你的action可以容易的用户交互.这些Result类型包括:
Chain Result - 用于 Action Chaining
Dispatcher Result - 用于 JSP 整合
FreeMarker Result - 用于 FreeMarker 整合
HttpHeader Result - 用于控制特殊的HTTP行为
JasperReports Result - 用于 JasperReports 整合
Redirect Result - 用于直接跳转到例外的URL
Redirect Action Result - 用于直接跳转到另外的action
Stream Result - 用于向浏览器返回一个InputStream (一般用于文件下载)
Velocity Result - 用于 Velocity 整合
XSL Result - 用于 XML/XSLT 整合
PlainText Result - 用于显示某个页面的原始的文本 (例如 jsp, html 等)
相关文章推荐
- Ibatis中parameterMap和MAP类型的Result的应用
- struts2之Action配置的各项默认值、result配置的各种试图转发类型及为应用指定多个struts配置文件
- struts2之Action配置的各项默认值、result配置的各种试图转发类型及为应用指定多个struts配置文件
- 关于Oracle的Clob数据类型在Hibernate中的应用
- 关于Clob类型在Hibernate中的应用小结
- struts2之Action配置的各项默认值、result配置的各种试图转发类型及为应用指定多个struts配置文件
- Hibernate应用SQL查询返回实体类型
- struts2之Action配置的各项默认值、result配置的各种试图转发类型及为应用指定多个struts配置文件
- Hibernate的count(*)函数通过调用uniqueResult方法的返回值类型
- hibernate中用uniqueResult() 方法能得到一个String 类型的值吗?
- struts2之Action配置的各项默认值、result配置的各种试图转发类型及为应用指定多个struts配置文件
- Struts2中的Result类型应用(action...etc跳转)
- struts2之Action配置的各项默认值、result配置的各种视图转发类型及为应用指定多个struts配置文件
- Java大对象类型的Hibernate映射
- 扩展Hibernate的数据类型
- 【原创】.NET Core应用类型(Portable apps & Self-contained apps)
- 有关hibernate 里的save, saveorupdate, merge的应用对比.引自hibernate官方文档
- Excel VBA高效办公应用-第二章-Excel VBA编辑基础-Part2(VBA的数据类型)
- 应用template技巧来确定函数返回值类型
- 【JavaEE学习笔记】Hibernate_05_数据类型转换和大对象处理,QBC(junit),DAO接口