zoukankan      html  css  js  c++  java
  • struts2 result type

    struts中的result类型总共有9种

    <result-types>
                <result-type name="chain" class="com.opensymphony.xwork2.ActionChainResult"/>
                <result-type name="dispatcher" class="org.apache.struts2.dispatcher.ServletDispatcherResult" default="true"/>
                <result-type name="freemarker" class="org.apache.struts2.views.freemarker.FreemarkerResult"/>
                <result-type name="httpheader" class="org.apache.struts2.dispatcher.HttpHeaderResult"/>
                <result-type name="redirect" class="org.apache.struts2.dispatcher.ServletRedirectResult"/>
                <result-type name="redirectAction" class="org.apache.struts2.dispatcher.ServletActionRedirectResult"/>
                <result-type name="stream" class="org.apache.struts2.dispatcher.StreamResult"/>
                <result-type name="velocity" class="org.apache.struts2.dispatcher.VelocityResult"/>
                <result-type name="xslt" class="org.apache.struts2.views.xslt.XSLTResult"/>
                <result-type name="plainText" class="org.apache.struts2.dispatcher.PlainTextResult" />
                <result-type name="postback" class="org.apache.struts2.dispatcher.PostbackResult" />
     </result-types>

    常用的有

      1.dispatcher:是result的默认类型,同servlet的转发,用于呈现jsp页面

      2.redirect:将用户请求重定向至已经配置好的url

      3.redirectAction:重定向至已经定义好的Action

      4.chain:将一个Action和另一个Action连接起来

      5.stream:将原始数据作为流返回浏览器端,适用于文件的下载

    ————我愿乘风破浪,踏遍黄沙海洋
  • 相关阅读:
    window忘记密码怎么办
    VS2015配置Andriod开发环境
    记一次 thread.blocked.count 线程过多的问题排查
    Spring的事务初见
    对mybatis的Handler 从使用角度介绍
    最简单的RPC框架实现
    记一次mybatis bindingexception 问题排查
    Java线程池—ThreadPool简介
    [springMvc] 源码分析笔记(二)
    [tomcat] tomcat简析(一)
  • 原文地址:https://www.cnblogs.com/wb1993/p/5615857.html
Copyright © 2011-2022 走看看