한글 깨짐 방지 => web.xml에 아래 코드 추가
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
JDBC Template => pom.xml에 아래 코드 추가
<!-- JDBC Template -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
JDBC Template => applicationJDBC.xml 파일을 생성해서 아래 코드 추가
<bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@192.168.164.128:1521:xe" />
<property name="username" value="jsp" />
<property name="password" value="1234" />
</bean>
<bean name="template" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource" />
</bean>
<!-- mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.3</version>
</dependency>
<!-- JDBC Template -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>
<!-- AOP -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.8.6</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.8.6</version>
</dependency>
<!-- AOP cglib -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
기본 셋팅
Spring 참고 => memme.tistory.com/76?category=895841
[200608.71일차] Spring 1 - 기본 설정 & 아파치 톰캣 배포 & Jenkins & Maven
~ [200623.82일차] Spring 12 - Scheduler, Ajax, RestController
Spring Boot 참고 => memme.tistory.com/89?category=895841
[200624.83일차] Spring boot 1 - STS 설치 & 프로젝트 만들기
~ [200701.88일차] Spring boot 6 - 마이크로 서비스
Spring 참고 => memme.tistory.com/76?category=895841
[200608.71일차] Spring 1 - 기본 설정 & 아파치 톰캣 배포 & Jenkins & Maven
~ [200623.82일차] Spring 12 - Scheduler, Ajax, RestController
Spring Boot 참고 => memme.tistory.com/89?category=895841
[200624.83일차] Spring boot 1 - STS 설치 & 프로젝트 만들기
~ [200701.88일차] Spring boot 6 - 마이크로 서비스
'Java > 정리' 카테고리의 다른 글
Oracle DB 계정 생성 (0) | 2021.08.12 |
---|---|
Spring 개발 환경 구현 & 세부 설정하기 (Eclipse, STS, Apach Tomcat) (0) | 2021.08.06 |
컴파일과 빌드 (0) | 2021.06.29 |