81,090
社区成员
发帖
与我相关
我的任务
分享
?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation=" http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="autoPage" />
<bean id="commentDao" class="org.mybatis.spring.mapper.MapperFactoryBean">
<property name="mapperInterface" value="com.mimi.dao.CommentDao"></property>
<property name="sqlSessionFactory" ref="sqlSessionFactory"></property>
</bean>
<bean id="commentService" class="com.mimi.service.impl.CommentServiceImpl">
<property name="commentDao" ref="commentDao"></property>
</bean>
<bean id="commentModule" class="com.mimi.module.CommentModule">
<property name="commentService" ref="commentService"></property>
</bean>
private CommentService commentService;
public CommentService getCommentService() {
return commentService;
}
public void setCommentService(CommentService commentService) {
this.commentService = commentService;
}
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext.xml,classpath:applicationContext.xml,classpath*:applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Xml是这样配置的。。。