개발관련/JAVA

Spring에서 Servlet.xml 설정 시 유의할 사항

길동무92 2016. 6. 1. 08:10

<beans xmlns:context="http://www.springframework.org/schema/context"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:cache="http://www.springframework.org/schema/cache"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:util="http://www.springframework.org/schema/util"
    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/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
                        http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
                        http://www.springframework.org/schema/util  http://www.springframework.org/schema/util/spring-util-3.1.xsd">



위와 같이 셋팅하는 경우가 많은데..

위의 xmlns에 정의한 name space는 반드시 아래 xsi:schemaLocation에 정의되어야 한다.

예를 들면 xmlns:util="http://www.springframework.org/schema/util" 를 추가하면

아래 schemaLocation 에도  http://www.springframework.org/schema/util  http://www.springframework.org/schema/util/spring-util-3.1.xsd 해당 스키마 및 xsd를 추가해야 한다.