티스토리 뷰
파악한 것만 내용 정리
----------------------------------------------------------------------------------------------------------------
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="true" version="3.0">
<display-name>File_Upload</display-name>
<!-- 서블릿 context-application.xml 내 bean 세팅 경로 -->
<!-- <param-value>/WEB-INF/classes/config/context-common.xml</param-value> -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/config/context-application.xml</param-value>
</context-param>
<!-- context로더 리스너 -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- <param-value>/WEB-INF/classes/config/context-common.xml</param-value> -->
<servlet>
<servlet-name>File_Upload</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/config/context-application.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>File_Upload</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!-- jsp setting -->
<!-- <servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>mappedfile</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet> -->
<!-- 인코딩 utf-8 세팅 -->
<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>
<!-- 첫페이지 세팅 -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
----------------------------------------------------------------------------------------------------------------
context-application.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- web.xml에서 contextConfigLocation 경로 수정 -->
<!-- spring bean 세팅 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:oxm="http://www.springframework.org/schema/oxm"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
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
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/oxm
http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd
http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
">
<!-- 기본 패키지명 세팅 -->
<mvc:annotation-driven />
<context:component-scan base-package="com.upload" />
<!-- xml 마샬러 세팅 ExceptionLog.java 필요하며 activation.jar com.upload.vo 안에 jaxb.index 필요 -->
<oxm:jaxb2-marshaller id="marshaller" contextPath="com.upload.vo"/>
<!-- app서비스명, 각종 프로퍼티 파일 세팅 -->
<util:properties id="UploadConfig" location="/WEB-INF/classes/config/settings.properties"/>
<!-- bean setting -->
<!-- 어노테이션 세팅 commons-pool-1.5.4.jar -->
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name = "messageConverters">
<list>
<bean class = "org.springframework.http.converter.StringHttpMessageConverter">
<property name = "supportedMediaTypes">
<list>
<bean class="org.springframework.http.MediaType">
<constructor-arg index="0" value="text"/>
<constructor-arg index="1" value="plain"/>
<constructor-arg index="2" value="UTF-8"/>
</bean>
<bean class="org.springframework.http.MediaType">
<constructor-arg index="0" value="*"/>
<constructor-arg index="1" value="*"/>
<constructor-arg index="2" value="UTF-8"/>
</bean>
</list>
</property>
</bean>
</list>
</property>
</bean>
<!-- 오라클 연동 : DataSource 방식 commons-dbcp-1.4.jar -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="#{UploadConfig['dataSource.driverClassName']}"/>
<property name="url" value="#{UploadConfig['dataSource.url']}"/>
<property name="username" value="#{UploadConfig['dataSource.username']}"/>
<property name="password" value="#{UploadConfig['dataSource.password']}"/>
<property name="defaultAutoCommit" value="true"/>
<property name="initialSize" value="0"/>
<property name="maxActive" value="10"/>
<property name="maxIdle" value="10"/>
</bean>
<!-- sql 템플릿 ibatis-2.3.0.677c.jar -->
<bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate">
<property name="sqlMapClient" ref="sqlMapClient" />
</bean>
<!-- sql 클라이언트 -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:config/sqlmap-config.xml" />
<!-- BLOB / CLOB 처리 관련 lobHandler 프로퍼티를 추가 -->
<property name="lobHandler" ref="oracleLobhandler"/>
</bean>
<!-- jdbcExtractor OracleLobHandler 사용하기 위해 세팅 -->
<bean id="nativeJdbcExtractor"
class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor"
lazy-init="true"/>
<!-- oracle 핸들러 CommonsDbcpNativeJdbcExtractor와 함께 사용 -->
<bean id="oracleLobhandler"
class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true">
<property name="nativeJdbcExtractor">
<ref local="nativeJdbcExtractor"/>
</property>
</bean>
<!-- multipart 알수없는 bean -->
<!-- <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="200000000"/>
</bean> -->
<!-- dataSource 매니저 -->
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<tx:annotation-driven transaction-manager="txManager"/>
<!-- aop 세팅 -->
<aop:config>
<aop:pointcut id="serviceMethod" expression="execution(* com.upload.*.*.*Service.*(..))" />
<aop:aspect ref="ExceptionLog">
<aop:after-throwing throwing="exception" pointcut-ref="serviceMethod" method="transfer" />
</aop:aspect>
</aop:config>
<aop:config>
<aop:pointcut id="serviceCommonLogging" expression="execution(* com.upload.*.*.*Service.*(..))" />
<aop:aspect ref="CommonAdvice">
<aop:around pointcut-ref="serviceCommonLogging" method="around" />
</aop:aspect>
</aop:config>
</beans>
'Java & Spring & SpringBoot' 카테고리의 다른 글
localhost, ip 도메인 연결 방법 (0) | 2017.12.18 |
---|---|
log4j level 설정 방법 및 level 별 설명 (0) | 2017.11.24 |
이클립스(eclipse) classpath 설정 (0) | 2017.09.28 |
eclipse Update SVN Cache 개선방법 (0) | 2017.09.20 |
톰캣 에러로그 At least one JAR was scanned for TLDs yet contained no TLDs 해결방법 (1) | 2017.09.12 |
- Total
- Today
- Yesterday
- 군산 여행
- 보성 여행
- Docker
- 군산 게스트하우스
- 은파호수공원
- 인터바이크
- 오라클 DB 링크
- 송내 카페
- 초원사진관
- 국제반점
- 고흥 여행
- 나래바이크
- 송내역 룸카페
- 남자 혼자 여행
- 영광 여행
- 송내역 카페
- 전국 일주 여행
- vscode
- 담양 여행
- 스쿠터 여행
- 리니지m
- kendo grid
- 남자 혼자 국내 여행
- 제주도 스쿠터 여행
- 군산 가볼만한곳
- 스쿠터 전국 일주
- 베스파LX
- 송내 룸카페
- 돌장갑
- 윈드스크린
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |