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

    ————我愿乘风破浪,踏遍黄沙海洋
  • 相关阅读:
    02-30 线性可分支持向量机
    02-28 scikit-learn库之线朴素贝叶斯
    02-27 朴素贝叶斯
    02-26 决策树(鸢尾花分类)
    047 选项模式
    第二节:师傅延伸的一些方法(复习_总结)
    第一节:登录流程
    第一节:对应拼音编码查询(后续更新)
    前端对象
    Form表单
  • 原文地址:https://www.cnblogs.com/wb1993/p/5615857.html
Copyright © 2011-2022 走看看