<?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:aop="http://www.springframework.org/schema/aop" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:websocket="http://www.springframework.org/schema/websocket" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket-4.0.xsd"> <!-- @Controller, @Service --> <mvc:annotation-driven /> <!-- jndi 설정 : Java Naming and Directory Interface --> <!-- jndi-name에서 "java:comp/env/여기 부분을 찾음 --> <!-- META-INF/context.xml에서 name의 값과 같음 --> <!-- WEB-INF/lib/ojdbc6.jar 파일 필요 --> <jee:jndi-lookup id="dataSource" jndi-name="java:comp/env/jdbc/oracle" /> <!-- jndi 설정을 안하면 아래 코드로 작성 --> <!-- DataSource 설정 --> <!-- <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" p:driverClassName="oracle.jdbc.OracleDriver" p:url="jdbc:oracle:thin:@localhost:1521:xe" p:username="test" p:password="1111"/> --> <!-- SqlSessionFactory 설정 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean" p:dataSource-ref="dataSource" p:configLocation="WEB-INF/mybatis-config.xml" /> <!-- SqlSessionTemplate 설정 --> <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> <constructor-arg ref="sqlSessionFactory" /> </bean> <!-- 여기까지 기본셋팅 --> <!-- Bean DAO설정 --> <!-- scope의 default는 싱글톤으로 만들어집니다. --> <bean scope="singleton" id="usersDAO" p:session-ref="sqlSession" class="com.pmi.lms.dao.UserDAOImpl"/> <!-- Bean Service설정 --> <bean id="usersService" p:userDAO-ref="usersDAO" class="com.pmi.lms.service.UserServiceImpl"/> <!-- multipartResolver 설정(멀티파트,업로드처리) --> <bean id="multipartResolver" p:defaultEncoding="UTF-8" p:maxUploadSize="104857600" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" /> <!-- util 설정 --> <bean id="rename" class="com.pmi.lms.util.FileRenameUtil"/> </beans> |