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 resource [/WEB-INF/DefaultServlet-servlet.xml]
To fix this error, change the name of
DefaultServlet
toDispatcherServlet
inweb.xml
; basically, after changing the...