君子博学而日参省乎己 则知明而行无过矣

博客园 首页 新随笔 联系 订阅 管理

2012年3月7日 #

摘要: In lastSpring auto-wiring in XMLexample, it will autowired the matched property of any bean in current Spring container. In most cases, you may need autowired property in a particular bean only.In Spring, you can use@Autowiredannotation to auto wire bean on the setter method, constructor or a field. 阅读全文
posted @ 2012-03-07 18:47 刺猬的温驯 阅读(451) 评论(0) 推荐(0) 编辑

摘要: packagecom.epeer.dao;publicinterfaceUserDao{publicvoidinsertUserIp(Stringstartip,Stringendip);}packagecom.epeer.dao;importjava.text.MessageFormat;importorg.springframework.jdbc.core.support.JdbcDaoSupport;publicclassUserDaoImplextendsJdbcDaoSupportimplementsUserDao{privatestaticfinalStringINSERT=&qu 阅读全文
posted @ 2012-03-07 18:11 刺猬的温驯 阅读(295) 评论(0) 推荐(0) 编辑

摘要: Spring applicationContext.xml的<context:component-scan>標籤用途比我想像的還要實用。而且後來才知道,有了<context:component-scan>,另一個<context:annotation-config/>標籤根本可以移除掉,因為被包含進去了。原本我survery Spring3通常只配置成<context:component-scan base-package="com.foo.bar"/>,意即在base-package下尋找有@Component和@Confi 阅读全文
posted @ 2012-03-07 17:18 刺猬的温驯 阅读(1641) 评论(0) 推荐(0) 编辑

摘要: 13.9.使用Spring的表单标签库 - Spring Framework reference 2.0.5 参考手册中文版13.9.使用Spring的表单标签库从2.0开始,Spring提供全面的,支持数据绑定的JSP标签来处理表单元素(如果你使用JSP和Spring的Web MVC框架的话)。 每个标签所支持的属性跟其对应的HTML标签相同,这样这些标签看起来就不陌生,而且很容易用。 由这些标签库生成的HTML页面符合HTML 4.01/XHTML 1.0标准。与其它的标签库不同,Spring的表单标签库和Spring Web MVC框架是集成在一起的,因此它们可以直接使用命令对象(com 阅读全文
posted @ 2012-03-07 17:16 刺猬的温驯 阅读(913) 评论(0) 推荐(0) 编辑