`
yan578351314
  • 浏览: 163775 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

struts1的action和struts2的action比较

 
阅读更多
对于struts1 ,当第一次**.do的请求过来时,在内存中的actionmapping中找到相对应的action,然后new出这个action放在缓存中,当第二次一样的请求过来时,还是找的这个action,所以对于struts1来说,action是单实例的 ,只有一个,如果在action中定义变量,就要非常小心了,因为并发问题,可能带来灾难性的后果,也不是不可以,我们可以加锁达到同步,只是在性能上就要折衷了

struts2 在struts1的基础上做了改进 ,对于struts2 ,每次请求过来都会new一个新的action , 所以说struts2的action是线程安全的 , 但同时也带来一个问题,每次都new一个action ,这样action的实例太多 , 在性能方面还是存在一定的缺陷的。

一句话概括:struts1是单例模式,而struts2是原型模式
分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    Struts1与Struts2本质区别

    为了脱离Web容器测试Struts 1的Action,必须借助于第三方扩展:Struts TestCase,该扩展下包含了系列的Mock对象(模拟了HttpServetRequest和HttpServletResponse对象),从而可以脱离Web容器测试Struts 1的Action类...

    Struts 2实战 struts2 in Action

    Struts 2实战 struts2 in Action

    struts2一个action处理多个请求 struts2实例

    struts2一个action处理多个请求

    Struts In Action 电子书 Struts1电子书

    Struts In Action 电子书 Struts1电子书

    struts1和struts2的区别

    Struts2和Struts1.x的差别,最明显的就是Struts2是一个pull-MVC架构。这是什么意思呢?从开发者角度看,就是说需要显示给用户的数据可以直接从Action中获取,而不像Struts1.x那样,必须把相应的Bean存到Page、...

    Struts2 in action

    Struts2 in action 中文版

    Struts2中Action接收参数的方法

    Struts2 框架中,Action 组件可以通过多种方式接收参数,这些方式包括使用 Action 的属性、使用 DomainModel 和使用 ModelDriven。下面将详细介绍这些方法: 使用 Action 的属性接收参数 在 Struts2 中,可以使用 ...

    Struts2 Action参数详细说明

    Struts2 Action参数详细说明,很有用的。

    struts2 in action 源码

    struts2 in action 源码

    struts2 in Action

    如果你想自学struts2,此文档是很好的自学宝典,经典struts2 in Action,能帮你建立整体的struts2思想,你还在犹豫什么

    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框架...

    Struts2inAction

    Struts2inAction 英文版 非常实用的一本Struts教材

    struts2 Action 电子书 下载

    struts2 Action 电子书 下载

    Struts 2实战 Struts 2 in action 的中文版

    Struts 2实战,Struts 2 in action 的中文版,pdf格式,讲的是Struts 2。此书是Struts 2的一本很经典的书。花几块钱在网上买的。。。。

    struts1.0和struts2

    struts1和struts2的区别其实并不是太大,两者的区别: Action 类: ◆Struts1要求Action类继承一个抽象基类。Struts1的一个普遍问题是使用抽象类编程而不是接口。 ◆Struts 2 Action类可以实现一个Action接口,也...

    Struts 2 in Action Struts2实战

    Struts2 实战 Struts 2 in Action

    struts2 result转向到action

    从jsp页面提交form表单后,在struts.xml中寻找匹配的action。在action中处理完业务后返回,在struts.xml中的result属性中转向到另外一个action。

    struts2.0之action

    有Struts 1.x经验的朋友都知道Action是Struts的核心内容,当然Struts 2.0也不例外。不过,Struts 1.x与Struts 2.0的Action模型很大的区别 本文档对struts2.0 action进行了详细介绍

    Struts2实战(Struts2 In Action中文版)

    Struts2 In Action中文版,完整PDF。

    struts2 Action 包 命名空间 servlet API

    struts2 Action 包 命名空间 servlet APIstruts2 Action 包 命名空间 servlet APIstruts2 Action 包 命名空间 servlet APIstruts2 Action 包 命名空间 servlet APIstruts2 Action 包 命名空间 servlet APIstruts2 ...

Global site tag (gtag.js) - Google Analytics