복붙노트

[SPRING] 예제 applicationContext.xml 파일을 찾을 수있는 곳

SPRING

예제 applicationContext.xml 파일을 찾을 수있는 곳

Spring 3 배포판에는 배포판에 패키지 된 프로젝트 폴더가있었습니다. 이 프로젝트 폴더에는 사용할 수있는 샘플 applicationContext.xml 파일이 있습니다. 그러나 여기에서 Spring 4 배포를 다운로드하면 프로젝트 폴더가 제공되지 않으며 샘플 applicationContext.xml을 찾을 수 없습니다. 예제 applicationContext.xml 파일을 어디에서 찾을 수 있습니까?

해결법

  1. ==============================

    1.자세한 정보 확인을 위해 여기를 사용할 수 있습니다.

    자세한 정보 확인을 위해 여기를 사용할 수 있습니다.

    아래 샘플은 다음과 같은 구성을 포함합니다.

    샘플 ApplicationContext.xml

    <?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:c="http://www.springframework.org/schema/c"
        xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-4.1.xsd">
    
        <context:property-placeholder location="classpath:/database.properties" />
        <context:component-scan base-package="com.foo" />
    
    
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
            <property name="driverClassName" value="${jdbc.driverClassName}" />
            <property name="url" value="${jdbc.url}" />
            <property name="username" value="${jdbc.username}" />
            <property name="password" value="${jdbc.password}" />
            <property name="initialSize" value="5" />
            <property name="maxActive" value="10" />
        </bean>
    
        <bean id="messageSource"
            class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename" value="messages" />
        </bean>
    
    </beans>
    
  2. from https://stackoverflow.com/questions/28414234/where-can-i-find-the-example-applicationcontext-xml-file by cc-by-sa and MIT license