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:
- Rename the
DefaultServlet-servlet.xml
file toDispatcherServlet-servlet.xml
; you can findDefaultServlet-servlet.xml
under thesrc/main/webapp/WEB-INF/
directory. - 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 aFileNotFoundException
error in the stack trace as follows:java.io.FileNotFoundException: Could not open ServletContext ...
Get Spring MVC Beginner’s Guide 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.