Understanding files created by the Spring MVC project template

Let's examine some of the files created by the template:

  • src/main/webapp/WEB-INF/web.xml: A front Controller servlet is declared here, along with other configurations:
<!-- Processes application requests --> 
<servlet> 
  <servlet-name>appServlet</servlet-name> 
  <servlet-  class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
  <init-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>/WEB-INF/spring/appServlet/servlet-      context.xml</param-value> 
  </init-param> 
  <load-on-startup>1</load-on-startup> 
</servlet> 

DispatcherServlet is the front Controller servlet. It is passed the path of the context (XML) file for configuring Spring DI. Recall that in the ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.