---
title: "Struts2的Result Type"
author: "savefrom"
date: "2008-12-26T17:11:34Z"
tags: []
categories: ["企业架构"]
slug: "struts2-result-type"
draft: false
lastmod: "2008-12-26T17:11:34Z"
id: 305413
url: "https://savefrom.iteye.com/blog/305413"
---

```java

chain

    用来处理Action链

    com.opensymphony.xwork2.ActionChainResult

dispatcher

    用来转向页面，通常处理JSP

    org.apache.struts2.dispatcher.ServletDispatcherResult

freemaker

    处理FreeMarker模板

    org.apache.struts2.views.freemarker.FreemarkerResult

httpheader

    控制特殊HTTP行为的结果类型

    org.apache.struts2.dispatcher.HttpHeaderResult

redirect

    重定向到一个URL

    org.apache.struts2.dispatcher.ServletRedirectResult

redirectAction

    重定向到一个Action

    org.apache.struts2.dispatcher.ServletActionRedirectResult

stream

    向浏览器发送InputSream对象，通常用来处理文件下载，还可用于返回AJAX数据

    org.apache.struts2.dispatcher.StreamResult

velocity

    处理Velocity模板

    org.apache.struts2.dispatcher.VelocityResult

xslt

    处理XML/XLST模板

    org.apache.struts2.views.xslt.XSLTResult

plainText

    显示原始文件内容，例如文件源代码

    org.apache.struts2.dispatcher.PlainTextResult

redirect-action

    重定向到一个Action

    org.apache.struts2.dispatcher.ServletActionRedirectResult

plaintext

    显示原始文件内容，例如文件源代码

    org.apache.struts2.dispatcher.PlainTextResult


```