`
ldzyz007
  • 浏览: 700968 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

struts2 result type=chain、dispatcher、redirect

阅读更多
dispatcher:用于页面转发,页面跳转过程一直是同一个线程,Action中的数据一直保存在。

redirect:可用于返回一个页面、一个action、链接到一个网址。
缺点:redirect把一个http返回码(SUCCESS)以及返回的页面位置一起重新发给web服务器,容纳后由web服务器产生一个新的HTTP请求,就会产生一个新的线程,保存在原来Action执行的线程中的数据就无法访问。
所以,result需要包含Action的数据,那么redirect不是一个可行的办法。因为新的HTTP请求时在Servlet容器的新的线程中处理的,ActionContext中的所有状态都不会存在。

chain:功能与redirect的action转发类似,不过与redirectaction转发功能不同的是它可以将Action中的数据一直保存在同一个HTTP请求中。
分享到:
评论

相关推荐

    struts2中的result的type类型

    struts2 跳转类型 result type chain dispatcher redirect redirect action

    OA_struts2_hibernate3_spring2.5.rar

    <result name="add_success" type="redirect">/common/pub_add_success.jsp</result> <result name="del_success" type="redirect">/common/pub_del_success.jsp</result> <result name="modify_success" ...

    JQuery_uploadify_struts2_jsp__ajax多文件上传

    <result name="upload" type="dispatcher"> /index.jsp </result> return "upload"; 开始我这里没有返回值,直接return null,以为它是ajax异步请求,不需要返回到某个页面,最后也导致页面显示:HTTP ERROR! ...

    Struts2_s2-016&017&ognl2.6.11_patch漏洞补丁

    <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="myDefaultActionMapper" class="com.struts2.MyDefaultActionMapper" /> <constant name="struts.mapper.class" value=...

    org.apache.struts2.dispatcher.FilterDispatcher

    org.apache.struts2.dispatcher.FilterDispatcher

    jfreechar 整合struts2.1.8版本生成线图,饼图,柱形图

    type : result类型 不写则选用superpackage的type struts-default.xml中的默认为dispatcher --> <result name="success" type="dispatcher">/talk.jsp</result> <!-- 参数设置 name:对应Action中...

    解决struts2下载异常的jar包 struts2-sunspoter-stream-1.0.jar

    有关struts2下载组件的具体介绍我就在此略过了,看此文的同志想必大多是碰到这样让人很是不爽的问题。 下面就将该问题的最终解决办法介绍...-- 添加如下内容 --> <result-types> <result-type name="streamx" class=...

    Struts2入门教程(全新完整版)

    org.apache.struts2.dispatcher.ServletActionRedirectResult 16 plainText 16 显示源文件内容,如文件源码 16 org.apache.struts2.dispatcher.PlainTextResult 16 freemarker 16 处理FreeMarker模板 16 org.apache....

    用Struts2新建一个应用的方法步骤

    org.apache.struts2.dispatcher.FilterDispatcher <filter-name>struts2 <url-pattern>/* 7.右击src——new——XML(Advanced Templates)。在File Name中输入struts.xml(必须为此名),单击Finish。Struts...

    struts2上传必备jar包,避免出现struts2的升级漏洞!自己吃亏后分享

    at org.apache.struts2.dispatcher.Dispatcher.cleanUpRequest(Dispatcher.java:837) at org.apache.struts2.dispatcher.ng.PrepareOperations.cleanupRequest(PrepareOperations.java:103) at org.apache.struts2....

    第一个struts程序

    org.apache.struts2.dispatcher.FilterDispatcher dispatcher这个单词写错了。 3、LoginAction.java这个文件中的方法写错了。public String execute(),excecute这个单词写错了。 4、struts.xml中的<result name=...

    struts2配置2.5版

    <?xml version="1.0" encoding="UTF-8"?... org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter <!-- 拦截所有的url --> <filter-name>struts2 <url-pattern>/* </web-app>

    Struts2 in action中文版

    第1章 Struts 2:现代Web框架 2 1.1 Web应用程序:快速学习 2 1.1.1 构建Web应用程序 2 1.1.2 基础技术简介 3 1.1.3 深入研究 6 1.2 Web应用程序框架 7 1.2.1 什么是框架 7 1.2.2 为什么使用框架 8 1.3 Struts 2框架...

    struts 2.2 api文档

    org.apache.struts2, org.apache.struts2.components, org.apache.struts2.components.template, org.apache.struts2.config, org.apache.struts2.dispatcher, org.apache.struts2.dispatcher.mapper, org.apache....

    Struts2属性文件详解

    Struts2属性文件详解 struts.configuration 该属性指定加载Struts 2配置文件的配置文件管理器.该属性的默认值是org.apache.Struts2.config.DefaultConfiguration, 这是Struts 2默认的配置文件管理器.如果需要实现...

    struts2 学习例子

    Struts2标签库提供了主题、模板支持,极大地简化了视图页面的编写,而且,struts2的主题、... <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter 4.标签的使用 。。。

    SSH笔记-result标签的type的使用

    SSH笔记 result标签里面 type的使用 demo包括dispatcher、chain、redirect、redirectAction、stream

    struts2 + spring + mybatis 框架整合jar包

    <filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name>...

    Apache的Struts2框架严重安全漏洞

    Apache的Struts2框架最近出了一个很严重的漏洞,可以直接执行系统命令 http://www.163.com?%28%27\u0023_memberAccess[\%27allowStaticMethodAccess\%27]%27%29%28meh%29=true&%28aaa%29%28%28%27\u0023context[\%27...

    Struts2整合SiteMesh技巧

    <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class> filter> <filter> <filter-name>sitemesh</filter-name> <filter-class>...

Global site tag (gtag.js) - Google Analytics