• 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:将原始数据作为流返回浏览器端,适用于文件的下载

    ————我愿乘风破浪,踏遍黄沙海洋
  • 相关阅读:
    《python编程从入门到实践》变量和简单数据类型
    《初学python》
    centos7 关闭防火墙
    记几个学习资源
    servlet-api.jar
    spring 对Map的一种扩展 MultiValueMap
    CPU飚高问题解决
    聊聊数据库优化
    netty的核心组件
    【转】 一个著名的日志系统是怎么设计出来的?
  • 原文地址:https://www.cnblogs.com/wb1993/p/5615857.html
Copyright © 2020-2023  润新知