本人在开发Web应用过程中遇到问题 总结出来的经验与大家分享,原来这认为在实现类中没有其他的属性,在spring的上下文中就不用写了,结果出错。后来把sqlMapClient加上就好用了。问题解决了。哈哈,挺菜吧,见笑了。
在Spring结合ibatis时要把SQL-CONFIG文件加到ApplicationContext.xml中要写成:
<
bean
id
="sqlMapClient"
class ="org.springframework.orm.ibatis.SqlMapClientFactoryBean" >
< property name ="configLocation"
value ="classpath:resource/sqlmap-config.xml" />
< property name ="dataSource" ref ="dataSource" />
</ bean >
class ="org.springframework.orm.ibatis.SqlMapClientFactoryBean" >
< property name ="configLocation"
value ="classpath:resource/sqlmap-config.xml" />
< property name ="dataSource" ref ="dataSource" />
</ bean >
在实现DAO时,如果你的类是继承SqlMapClientDaoSupport时,如果你的类中没有其它属性的话时,在ApplicationContext.xml要写成:



