MyEclispe의 Spring이 적용된 applicationContext.xml 를 Spring Beans의 Show Graph로 보게 되면 아래 그림과 같은 계층도를 볼 수 있음
- applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>DBQuery</value>
<value>Messages</value>
</list>
</property>
</bean>
<bean id="messageSourceAccessor" class="org.springframework.context.support.MessageSourceAccessor">
<constructor-arg>
<ref local="messageSource" />
</constructor-arg>
</bean>
<bean id="loggingAdvice" class="com.actsoft.project.advice.LoggingAdvice" />
<bean id="loggingAspect" abstract="true" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames">
<list>
<value>loggingAdvice</value>
</list>
</property>
</bean>
<bean id="allAspect" abstract="true" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="interceptorNames">
<list>
<value>loggingAdvice</value>
<value>emailNotificationThrowsAdvice</value>
</list>
</property>
</bean>
<bean id="emailNotificationThrowsAdvice" class="com.actsoft.project.advice.EmailNotificationThrowsAdvice">
<property name="mailSender">
<ref local="mailSender" />
</property>
</bean>
<bean id="mailSender" class="com.actsoft.project.common.mail.ExceptionMailSender">
<property name="sender">
<ref bean="sender" />
</property>
<property name="to">
<value>nimba@actsoft.co.kr</value>
</property>
<property name="from">
<value>nimba@actsoft.co.kr</value>
</property>
<property name="messageSourceAccessor">
<ref local="messageSourceAccessor" />
</property>
</bean>
<bean id="sender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host">
<value>mail.actsoft.co.kr</value>
</property>
</bean>
<!--
- Member Service
-->
<bean id="urlMapping_members" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<!-- members module mapping -->
<prop key="/Members/list.do">membersController</prop>
<prop key="/Members/view.do">membersController</prop>
</props>
</property>
</bean>
<bean id="membersController" class="com.actsoft.project.controller.MembersController">
<property name="methodNameResolver">
<ref local="projectMembersNameResolver" />
</property>
<property name="thisService" ref="membersService" />
</bean>
<bean id="projectMembersNameResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
<property name="mappings">
<props>
<prop key="/Members/list.do">list</prop>
<prop key="/Members/view.do">view</prop>
</props>
</property>
</bean>
<!--
- DBCP Config
-->
<bean id="dsProject" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>net.sourceforge.jtds.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:jtds:sqlserver://x.x.x.x:1433/x</value>
</property>
<property name="username">
<value>x</value>
</property>
<property name="password">
<value>x</value>
</property>
<property name="maxActive">
<value>100</value>
</property>
<property name="maxIdle">
<value>30</value>
</property>
<property name="maxWait">
<value>1000</value>
</property>
<property name="defaultAutoCommit">
<value>true</value>
</property>
<property name="removeAbandoned">
<value>true</value>
</property>
<property name="removeAbandonedTimeout">
<value>60</value>
</property>
</bean>
<!--
- Transaction manager for a single JDBC DataSource
-->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dsProject"/>
</bean>
<!--
- SqlMap setup for Ibatis Database Layer
-->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>/WEB-INF/sqlmap-config.xml</value>
</property>
<property name="dataSource" ref="dsProject"/>
</bean>
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="preInterceptors">
<list>
<ref bean="loggingAdvice"/>
<ref bean="emailNotificationThrowsAdvice"/>
</list>
</property>
<property name="transactionAttributes">
<props>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<!-- static view controller -->
<bean id="staticViewController" class="com.actsoft.project.web.UrlController" />
<!-- MultiActionController controller -->
<bean id="startController" class="com.actsoft.project.controller.MultiActionCtr">
<property name="methodNameResolver" ref="multiActionCtrMethodNameResolver" />
</bean>
<bean id="multiActionCtrMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
<property name="mappings">
<props>
<prop key="/index.do">firstPage</prop>
<prop key="/test.do">testPage</prop>
</props>
</property>
</bean>
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<!-- static view mapping -->
<prop key="/**/*.html">staticViewController</prop>
<prop key="/index.do">startController</prop>
<prop key="/test.do">startController</prop>
</props>
</property>
</bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="cache" value="false" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<!--
- URL Mapping Config
-->
<bean id="urlMapping_ErrorPage" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="/error/404.do">httpErrorCtr</prop>
<prop key="/error/500.do">httpErrorCtr</prop>
</props>
</property>
</bean>
<!--
- httpErrorCtr Controller Beans
-->
<bean id="httpErrorCtr" class="com.actsoft.project.web.HttpErrorCtr">
<property name="methodNameResolver" ref="httpErrorCtrMethodNameResolver" />
</bean>
<bean id="httpErrorCtrMethodNameResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
<property name="mappings">
<props>
<prop key="/error/404.do">processErrorCode404</prop>
<prop key="/error/500.do">processErrorCode500</prop>
</props>
</property>
</bean>
</beans>
'programming > spring_framework' 카테고리의 다른 글
Spring Framework 구조도 (0) | 2012.03.21 |
---|---|
‘/home.html’ 에 대한 요청 처리 과정 (0) | 2012.03.21 |
Spring Controller에서 뷰(JSP) 페이지로 값 넘기기 (2) | 2012.03.21 |
MyEclipse를 이용하여 Spring Project 적용하기 (0) | 2012.03.21 |
ANT를 이용한 테이블 생성 (0) | 2012.03.21 |