张志峰的博客

水滴石川,积少成多。

导航

随笔分类 -  java spring

摘要:使用注解来构造IoC容器用注解来向Spring容器注册Bean。需要在applicationContext.xml中注册。如:在base-package指明一个包1 表明cn.gacl.java包及其子包中,如果某个类的头上带有特定的注解【@Component/@Repository/@Servic... 阅读全文

posted @ 2015-05-05 14:33 ╰★张志峰★╮ 阅读(193) 评论(0) 推荐(0)

摘要:Hibernate SQL方言 (hibernate.dialect)数据库hibernate方言DB2org.hibernate.dialect.DB2DialectDB2 AS/400org.hibernate.dialect.DB2400DialectDB2 OS390org.hibernat... 阅读全文

posted @ 2015-02-12 14:22 ╰★张志峰★╮ 阅读(8204) 评论(0) 推荐(0)

摘要:造成此问题的原因是: 在applicationContext.xml中引用 但是在User1Service中没有定义 成员变量的属性private User1DAO user1DAO; public User1DAO getUser1DAO() { return user1D... 阅读全文

posted @ 2015-02-11 15:54 ╰★张志峰★╮ 阅读(5706) 评论(1) 推荐(0)

摘要:spring中context:property-placeholder/元素 转载1.有些参数在某些阶段中是常量比如 :a、在开发阶段我们连接数据库时的连接url,username,password,driverClass等b、分布式应用中client端访问server端所用的server地址,po... 阅读全文

posted @ 2015-02-02 14:05 ╰★张志峰★╮ 阅读(191) 评论(0) 推荐(0)

摘要:Spring使用配置文件读取jdbc.properties在beans.xml中加入两个必须的bean[html] 在web-inf下面的jdbc.properties[html]jdbc.driverClassName=com.mysql.jdbc.Driverjdbc.url=jdbc:... 阅读全文

posted @ 2015-01-29 18:12 ╰★张志峰★╮ 阅读(4161) 评论(0) 推荐(0)

摘要:@RequestMapping用法详解之地址映射前段时间项目中用到了RESTful模式来开发程序,但是当用POST、PUT模式提交数据时,发现服务器端接受不到提交的数据(服务器端参数绑定没有加任何注解),查看了提交方式为application/json, 而且服务器端通过request.getRea... 阅读全文

posted @ 2015-01-29 15:18 ╰★张志峰★╮ 阅读(208) 评论(0) 推荐(0)

摘要:ContextLoaderListener的作用就是启动Web容器时,自动装配ApplicationContext的配置信息。因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启动容器时,就会默认执行它实现的方法。至于ApplicationContex... 阅读全文

posted @ 2015-01-21 16:05 ╰★张志峰★╮ 阅读(125) 评论(0) 推荐(0)

摘要:@Repository、@Service、@Controller 和 @Component 注解:http://blog.csdn.net/ye1992/article/details/19971467 阅读全文

posted @ 2015-01-16 13:43 ╰★张志峰★╮ 阅读(240) 评论(0) 推荐(0)

摘要:Spring的注解形式:@Repository、@Service、@Controller,它们分别对应存储层Bean,业务层Bean,和展示层Bean。@Repository、@Service、@Controller 和 @Component 将类标识为BeanSpring 自 2.0 版本开始,陆... 阅读全文

posted @ 2015-01-16 13:42 ╰★张志峰★╮ 阅读(47048) 评论(0) 推荐(6)