ITeye博客

Spring

共 5 篇文章

Spring 上传文件注意事项

利用springMVC org.springframework.web.multipart.commons.CommonsMultipartResolver上传文件,可以设文件大小与存放位置。 <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="defaultEncoding" value="utf-8"></property> <!-- 10000M --> <property name="maxUpl…

2016-12-28 08:58 · Spring

Spring MVC redirect url 不带参数

@RequestMapping(value = "/loginFail", produces = "application/json;charset=UTF-8") public String loginFail(RedirectAttributes attr ,HttpServletResponse response,HttpServletRequest request) { attr.addFlashAttribute("failureMessage", "用户名或密码错误"); return "redirect:login"; } 用RedirectAttributes.addFlas…

2016-06-22 15:19 · Spring

Spring 国际化

资源文件: messages_zh_CN.properties messages_en_US.properties 在xml 中加载资源 <bean id="tplMessageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="cacheSeconds" value="0" /> <property name="basenames"> <list> <value>/WEB-INF/languages/cms_tpl/message…

2015-11-10 09:51 · Spring

Spring 事务 不回滚问题

Spring 事务 Service层加了try ...catch...后不回滚问题, 文章转载于: http://www.360doc.com/content/12/1109/18/6161903_246870991.shtml, 该文章说的很专业,大家遇到同样的问题可以参考参考

2015-08-17 20:54 · Spring

Spring ioc 的原理

转载于:http://blog.csdn.net/m13666368773/article/details/7802126 1. IoC理论的背景 我们都知道,在采用面向对象方法设计的软件系统中,它的底层实现都是由N个对象组成的,所有的对象通过彼此的合作,最终实现系统的业务逻辑。 图1:软件系统中耦合的对象 如果我们打开机械式手表的后盖,就会看到与上面类似的情形,各个齿轮分别带动时针、分针和秒针顺时针旋转,从而在表盘上产生正确的时间。图1中描述的就是这样的一个齿轮组,它拥有多个独立的齿轮,这些齿轮相互啮合在一起,协同工作,共同完成某项任务。我们可以看到,在这样的齿轮组中,如果有一个齿轮出了问…

2015-03-03 10:12 · Spring