
Struts
文章平均质量分 84
txidol-Fly
洞庭湖上的一颗小岛,钓鱼,养猫,学程序。(Java,大数据,PMP,ACP)
展开
-
【Struts2源码】@Inject查找并缓存注入器
注解@Inject的操作类是ContainerImpl,@Inject在Struts中用到了很多,主要用来构造函数、属性、方法及方法参数注入,当调用ContainerImpl的Inject方法时,这些部分就启动,ContainerImpl初始化时,缓存这些构建方法 这里我们只分析查找这些带@Inject的注入器,并把它们缓存起来。 1.初始化一个注入器Map,用来放置找到@Inject后实例化原创 2013-05-15 08:54:06 · 2521 阅读 · 0 评论 -
【便利贴】Struts默认标配
今天看了下Struts2 的struts-default.properties 配置,发现路还很长,拷了下官网的 Struts2默认配置,下还包括最新的struts-default.xml ### Struts default properties ###(can be overridden by a struts.properties file in the root of the cla原创 2013-05-08 16:06:12 · 2586 阅读 · 0 评论 -
Struts2注解(旧&新)
旧版本使用注解: 开始使用注解使用的是 struts2-core-2.0.11.jar 这个时候的过滤器是org.apache.struts2.dispatcher.FilterDispatcher 可以在web.xml里面指定action的祖包actionPackages actionPackages manning 被注解的内在如上mann原创 2013-04-01 11:24:50 · 1387 阅读 · 0 评论 -
【装饰模式】罗列Struts2中的那些装饰类
这篇并不讲装饰模式的原理,只是罗列Struts2中使用的一些装饰类,总结在一起提供欣赏借鉴。 案列1 StrutsRequestWrapper 首先回忆下Servlet中针对ServletRequest的装饰类ServletRequestWrapper public class ServletRequestWrapper implements ServletReques原创 2013-05-19 11:12:08 · 1965 阅读 · 0 评论 -
【责任链模式】模拟Struts责任链工作流及简单AOP实现
详细代码:http://download.youkuaiyun.com/detail/tanxiang21/5402599 模拟Struts2的工作责任链过程,接口调用invoke方法执行 public interface ActionInvocation{ Object getAction(); boolean isExecuted(); Result getResult()原创 2013-05-18 13:25:53 · 2529 阅读 · 0 评论 -
【策略模式】模拟Struts选择策略决策转移
目标:我们需要一个计算价格的类,有时候会打折 1.我们先设计一个接口 public interface PriceCalculationStrategy { public double calculatePrice(double price , double copies); public boolean match(double price , double copies)原创 2013-05-16 14:25:06 · 1146 阅读 · 0 评论 -
【便利贴】Struts性能优化
Performance tuning 转载官网,少许翻译 The following are some tips and tricks to squeeze the most performance out of Struts 2. Important OGNL update For Struts 2 versions before 2.3: the O翻译 2013-05-08 16:37:49 · 1382 阅读 · 0 评论