Struts2 result type(结果类型)
2012-04-06 10:55
471 查看
在struts2框架中,当action处理完之后,就应该向用户返回结果信息,该任务被分为两部分:结果类型和结果本身。
结果类型提供了返回给用户信息类型的实现细节。结果类型通常在Struts2中就已预定义好了(见下表),或者是由插件提供,开发人员也可以自定义结果类型。默认配置的结果类型是dispatcher,该结果类型使用JSP来向用户显示结果。当定义了结果类型之后,该结果类型可以在不同的action中重复使用。
结果类型提供了返回给用户信息类型的实现细节。结果类型通常在Struts2中就已预定义好了(见下表),或者是由插件提供,开发人员也可以自定义结果类型。默认配置的结果类型是dispatcher,该结果类型使用JSP来向用户显示结果。当定义了结果类型之后,该结果类型可以在不同的action中重复使用。
Struts2框架提供的结果类型
已配置结果类型名 | 类 名 | 描 述 |
dispatcher | org.apache.struts2.dispatcher. ServletDispatcherResult | 默认结果类型,用来呈现JSP页面 |
chain | com.opensymphony.xwork2. ActionChainResult | 将action和另外一个action链接起来 |
freemarker | org.apache.struts2.views.freemarker. FreemarkerResult | 呈现Freemarker模板 |
httpheader | org.apache.struts2.dispatcher. HttpHeaderResult | 返回一个已配置好的HTTP头信息响应 |
redirect | org.apache.struts2.dispatcher. ServletRedirectResult | 将用户重定向到一个已配置好的URL |
redirectAction | org.apache.struts2.dispatcher. ServletActionRedirectResult | 将用户重定向到一个已定义好的action |
stream | org.apache.struts2.dispatcher. StreamResult | 将原始数据作为流传递回浏览器端, 该结果类型对下载的内容和图片非常有用 |
velocity | org.apache.struts2.dispatcher. VelocityResult | 呈现Velocity模板 |
xslt | org.apache.struts2.views.xslt. XSLTResult | 呈现XML到浏览器, 该XML可以通过XSL模板进行转换 |
plaintext | org.apache.struts2.dispatcher. PlainTextResult | 返回普通文本类容 |
相关文章推荐
- Struts2 result type(结果类型)
- struts2 result type(结果类型)
- Struts2 result type(结果类型)
- Struts2 result type(结果类型)
- Struts2 result type(结果类型)
- Struts2 result type(结果类型)
- Struts2中的结果类型_result_type
- Struts2 result type(结果类型)
- struts2 07 结果类型 ResultType
- Struts2 result type(结果类型)
- Struts2 result type(结果类型)
- struts2_07_result type(结果类型)
- Struts2 result type(结果类型)
- Struts2 拦截器 默认Action 一些常量的设置 Result常用的结果类型
- SharePoint 2013 客户化(Customize) 搜索结果(Search result)-显示模版(Dispaly template)&搜索结果类型(Search Result Type)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2的result结果类型
- Struts2的result结果类型
- Struts2框架提供的结果类型及result的name属性和type属性
- Struts2结果类型(Result Types)