When I reviewed SpringMVC, and I rolled out the code following the video, I noticed that when I clicked on the hyperlink to access the controller, it kept saying 404,



No, obviously the same ah, right after a code, it is the same ah. Run again, or 404, big head, so the Internet search, the Internet said there may be these reasons;

1. Whether the Controller layer is labeled as an @Controller component

2, MVC filter is correct, yes /, no /*

3. Is support for the @Controller tag configured: < MVC :annotation-driven />

4. Is the scan of the Controller layer properly configured

5. Check that the relevant configuration in web.xml is correct

And so on;

Since I wrote the code after the video, this should be fine;

Think about the environment

Finally, it took a long time to solve the problem. The method is as follows:

Open the project structure and change the directory of Web Resource Dictory to the directory of your project under Facets





.

Successful entry after modification!!

Part of the code:

Engineering structure:

web.xml:

springmvc.xml:

index.jsp:

controller:

Reference: https://www.cnblogs.com/jpfss… https://blog.csdn.net/weixin_… Bi li bi li learning video address: https://www.bilibili.com/vide…