struts
lastwang
这个作者很懒,什么都没留下…
展开
-
Struts2中根据key取出map中对应的value
在action中有:long userId = 1; Map<Long,String> map = new HashMap<Long,String>(); map.put(1L, "aa"); map.put(2L, "bb"); map.put(3L, "cc"); ma...原创 2014-05-11 01:57:37 · 277 阅读 · 0 评论 -
struts1 struts2 单例分析
Struts1 : Action是单例模式并且必须是线程安全的,因为仅有Action的一个实例来处理所有的请求。单例策略限制了Struts1能做的事,并且要在开发时特别小心。Action资源必须是线程安全的或同步。Struts2 : Action对象为每一个请求产生一个实例,因此没有线程安全问题。(实际上,servlet容器给每个请求产生许多可丢弃的对象,并且不会导致性能和垃圾回收问题) ...原创 2014-03-17 11:13:54 · 88 阅读 · 0 评论