![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring
lchina1314
这个作者很懒,什么都没留下…
展开
-
aop advisor说明以及The prefix "aop" for element "aop:config" is not bound.错误原因
原因:我们在定义申明AOP的时候。没有加载schema。解决:首先应该加载JAR包。还要在中要加入“xmlns:aop”的命名申明,并在“xsi:schemaLocation”中指定aop配置的schema的地址配置文件如下:xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "xmlns:aop="ht原创 2013-04-08 19:44:55 · 1241 阅读 · 0 评论 -
SpringMVC redirect重定向传递参数
URL不接参数的非重定向可以使用Model.addAttribute(Object arg1); 重定向可以使用如下方法传递对象参数RedirectAttributes.addFlashAttribute(String arg0, Object arg1) 其他传递方法则可参考RedirectAttributes类的方法 ...原创 2014-04-04 14:46:56 · 243 阅读 · 0 评论 -
SpringMVC Controller层中 request接收参数乱码
直接使用String email = request.getParameter("email"); 接收到email是乱码,需要转换email = new String(request.getParameter("email").getBytes("ISO-8859-1"),"UTF-8"); 这样麻烦还需要处理异常。还可以这么解决:web.xml<filter...原创 2014-02-26 11:09:14 · 163 阅读 · 0 评论 -
aop advisor说明以及The prefix "aop" for element "aop:config" is not bound.错误原因
原因:我们在定义申明AOP的时候。没有加载schema。解决:首先应该加载JAR包。还要在<beans>中要加入“xmlns:aop”的命名申明,并在“xsi:schemaLocation”中指定aop配置的schema的地址配置文件如下:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="htt...原创 2013-01-17 22:34:45 · 172 阅读 · 0 评论 -
Spring如何实现初始化完Bean调用指定函数
第一种: 实现InitializingBean接口,重写afterPropertiesSet()方法。第二种:属性配置文件init-method指定。同理还有销毁方式,所不同的是:第一种:需要实现DisposableBean中的destroy()方法。第二种destroy-method指定。...2013-04-08 19:44:00 · 202 阅读 · 0 评论 -
Spring配置文件的bean元素,scope属性值说明
Spring 配置文件的bean元素,scope属性值说明:1、singleton,单例。2、prototype,表示每次从容器中取出bean时,都会生出一个新实例,相当于一个new出来一个对象。3、request,该属性是基于web的,表示每次接受一个请求时,都会生出一个新实例,在这种情况下,request与prototype一样。4、session,表示在每个sessi...2013-04-08 19:44:00 · 180 阅读 · 0 评论 -
aop advisor说明以及The prefix "aop" for element "aop:config" is not bound.错误原因
原因:我们在定义申明AOP的时候。没有加载schema。解决:首先应该加载JAR包。还要在<beans>中要加入“xmlns:aop”的命名申明,并在“xsi:schemaLocation”中指定aop配置的schema的地址配置文件如下:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="h...2013-04-08 19:44:00 · 116 阅读 · 0 评论 -
Spring配置文件的bean元素,scope属性值说明
Spring 配置文件的bean元素,scope属性值说明:1、singleton,单例。2、prototype,表示每次从容器中取出bean时,都会生出一个新实例,相当于一个new出来一个对象。3、request,该属性是基于web的,表示每次接受一个请求时,都会生出一个新实例,在这种情况下,request与prototype一样。4、session,表示在每个session中该原创 2013-04-08 19:44:04 · 780 阅读 · 0 评论 -
struts2+spring框架
1.复制struts2-spring-plugin-x-x-x.jar和相应的spring.jar到/WEB-INF/lib目录下。 struts2-spring-plugin-x-x-x.jar在struts2的lib里,x-x-x为版本号 2.在struts.properties中设置struts.objectFactory属性值struts.properti原创 2013-04-08 19:45:08 · 486 阅读 · 0 评论 -
Spring4.x MVC responsebody 406错误的解决方案
Spring MVC REST 风格API升级到Spring4.x(4.1.1.RELEASE)+的时候报了406错误。结合网上方案,最终定位为:1、<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-co...原创 2015-09-10 17:32:57 · 174 阅读 · 0 评论