Learn Java for Web Development

(Tina Meador) #1

242 CHAPTER 5: Building Java Web Applications with Spring Web MVC


The servlet-context.xml file is loaded by the Spring’s DispatcherServlet, which receives all
requests coming into the application. Listing 5-37 illustrates servlet-context.xml.


Listing 5-37. The servlet-context.xml of the Hello World Application



  1. <?xml version="1.0" encoding="UTF-8"?>

  2. <beans:beans xmlns="http://www.springframework.org/schema/mvc"

  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  4. xmlns:beans="http://www.springframework.org/schema/beans"

  5. xmlns:context="http://www.springframework.org/schema/context"

  6. xsi:schemaLocation="http://www.springframework.org/schema/mvc

  7. http://www.springframework.org/schema/mvc/spring-mvc.xsd

  8. http://www.springframework.org/schema/beans

  9. http://www.springframework.org/schema/beans/spring-beans.xsd

  10. http://www.springframework.org/schema/context

  11. http://www.springframework.org/schema/context/spring-context.xsd">












Documentation