If you try the same with the extension, it will work:
/testMVC/index.htm OR /testMVC/index.jsp
In this scenario, have a look at the
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>spring</servlet-name> | |
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> | |
<load-on-startup>1</load-on-startup> | |
</servlet> | |
<servlet-mapping> | |
<servlet-name>spring</servlet-name> | |
<url-pattern>/</url-pattern> | |
</servlet-mapping> |
If you want to make sure it works without the extension, you need to change in the web.xml as follows:
Wondering what is the change? We are telling Spring servlet to take care of all url patterns. So all the requests will be handled by Spring. When you do this fix and make it working, you might encounter another issue which we'll see in the next post. Look forward to solve the issue: Unable to load external CSS file in SpringMVC
No comments:
Post a Comment