<?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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

  <display-name>springmvc2</display-name>

 <!-- 요청을 받으면 처리해주는 컨트롤러역할(클래스)등록 -->

 

 <!-- word(먼저 실행된다),hello(요청을 받아서 처리) -->

  <servlet> <!-- (2)으로 실행 -->

  <servlet-name>hello</servlet-name>

  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

  <init-param><!--외부 파일을 불러올때 -->

  <param-name>contextConfigLocation(매개변수명)</param-name>

  <param-value><!--불러올 파일명 -->

  /WEB-INF/hello-servlet.xml

  /WEB-INF/word-servlet.xml

  </param-value>

  </init-param>

  <load-on-startup>2</load-on-startup><!--실행 우선순위-->

  </servlet>

 

  <servlet><!-- (1)으로 실행 -->

  <servlet-name>word</servlet-name>

  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

  <load-on-startup>1</load-on-startup>

  </servlet>

 

  <!-- 요청받아서처리는 한번밖에 쓸수 없다 위에서 하나더만들수 없다 -->

  <servlet-mapping> <!-- (2)번의 요청을받아서 (3)으로 실행 -->

  <servlet-name>hello</servlet-name>

  <url-pattern>*.do</url-pattern>

  </servlet-mapping>

 

  <welcome-file-list>

    <welcome-file>index.html</welcome-file>

    <welcome-file>index.htm</welcome-file>

    <welcome-file>index.jsp</welcome-file>

    <welcome-file>default.html</welcome-file>

    <welcome-file>default.htm</welcome-file>

    <welcome-file>default.jsp</welcome-file>

  </welcome-file-list>

</web-app>

by 맑은소금 2014. 3. 13. 10:17