Book Image

Spring MVC Beginner's Guide

By : Amuthan Ganeshan
Book Image

Spring MVC Beginner's Guide

By: Amuthan Ganeshan

Overview of this book

Table of Contents (19 chapters)
Spring MVC Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – understanding the web application context


You have received enough of an introduction on the web application context; now, tweak a little bit with the name and location of the web application context configuration file (DefaultServlet-servlet.xml) and observe the effect. Perform the following steps:

  1. Rename the DefaultServlet-servlet.xml file to DispatcherServlet-servlet.xml; you can find DefaultServlet-servlet.xml under the src/main/webapp/WEB-INF/ directory.

  2. Then, run your webstore project again and enter the URL, http://localhost:8080/webstore/; you will see an HTTP Status 500 error message on your web page and a FileNotFoundException error in the stack trace as follows:

    java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/DefaultServlet-servlet.xml]
    

    An error message displaying FileNotFoundException for DefaultServlet-servlet.xml

  3. To fix this error, change the name of DefaultServlet to DispatcherServlet in web.xml; basically, after changing the...