---
title: "Struts2 Action的返回结果类型"
author: "suhongliang5332"
date: "2013-01-25T11:39:01Z"
tags: []
categories: ["Web前端"]
slug: "struts2-action"
draft: false
lastmod: "2013-01-25T11:39:35Z"
id: 1775600
url: "https://8586.iteye.com/blog/1775600"
---

已配置结果类型名  类 名 描 述 dispatcher

org.apache.struts2.dispatcher.Se

rvletDispatcherResult

默认结果类型，用来呈现JSP页面 chain

com.opensymphony.xwork2.Actio

nChainResult

将action和另外一个action链接起来 freemarker

org.apache.struts2.views.freemar

ker.FreemarkerResult

呈现Freemarker模板 httpheader

org.apache.struts2.dispatcher.Htt

pHeaderResult

返回一个已配置好的HTTP头信息响应 redirect

org.apache.struts2.dispatcher.Se

rvletRedirectResult

将用户重定向到一个已配置好的URL redirectAction

org.apache.struts2.dispatcher.Se

rvletActionRedirectResult

将用户重定向到一个已定义好的action stream

org.apache.struts2.dispatcher.St

reamResult

将原始数据作为流传递回浏览器端，该结果类型对下载的内容和图片非常有用 velocity

org.apache.struts2.dispatcher.Ve

locityResult

呈现Velocity模板 xslt

org.apache.struts2.views.xslt.XSL

TResult

呈现XML到浏览器，该XML可以通过XSL模板进行转换 plaintext

org.apache.struts2.dispatcher.Pl

ainTextResult

返回普通文本类容