struts2 Result 类型说明

24 篇文章 0 订阅
14 篇文章 0 订阅

struts2 的 action 支持很多返回对象的类型,下表一一列出:


Skip to end of metadata
Go to start of metadata

Most use cases can be divided into two phases. First, we need to change or query the application's state, and then we need to present an updated view of the application. The Action class manages the application's state, and the Result Type manages the view.

Predefined Result Types

The framework provides several implementations of the com.opensymphony.xwork2.Result interface, ready to use in your own applications.

Chain Result

Used for Action Chaining

Dispatcher Result

Used for web resource integration, including JSP integration

FreeMarker Result

Used for FreeMarker integration

HttpHeader Result

Used to control special HTTP behaviors

Redirect Result

Used to redirect to another URL (web resource)

Redirect Action Result

Used to redirect to another action mapping

Stream Result

Used to stream an InputStream back to the browser (usually for file downloads)

Velocity Result

Used for Velocity integration

XSL Result

Used for XML/XSLT integration

PlainText Result

Used to display the raw content of a particular page (i.e jsp, HTML)

Tiles 2 Result

Used to provide Tiles 2 integration

Tiles 3 Result

Used to provide Tiles 3 integration

Postback Result

Used to postback request parameters as a form to the specified destination

JSON Result Used to serialize actions into JSON


https://cwiki.apache.org/confluence/display/WW/Result+Types

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值