[Stepping on the pit record] How to configure SpringMVC is 404

[Stepping on the pit record] How to configure SpringMVC is 404

foreword

On the way to learn SpringMVC, I really encountered a roadblock when I opened the door. When configuring, it has always been configured according to the video of Silicon Valley. But when it runs, it is always 404, which is very annoying. When configuring the environment, it was configured at 11:00 in the evening and then at 11:30, and it was very painful to find the error. From 12.00 in the evening to 1.30 in the middle of the night, it was not found, and the next day was stuck for another day, until It was almost an hour before the third day that I figured it out.

insert image description here

First of all thanks in advance 夜星大佬和杨总. Yexing boss can help me find mistakes remotely, and Mr. Yang can give me advice! Bow at this 90°. At the same time, I hope this blog can help more friends! !

PS: Although the process of finding bugs is painful, the rewards are very large. Not only let you learn a lot of experience but also familiarize you with code and configuration!


mistake

The error is that 404 is reported all the time, which means that the path cannot be found. How to try the path or 404. I believe that everyone also hates 404 very much hahaha.

We can see that there are no errors, and there are no problems with the configuration and code. But it's a 404 when it runs.

insert image description here

I started and 夜星大佬thought it was a path problem, then went to see the path problem:

insert image description here

You can see that there is no problem with the path. At this time, I am very helpless 55555555555, because he does not report any errors, and the configuration is all right.

View source image


reason

The reason for my mistake is really 55555555 that I couldn't find at night, because I tried all the methods on the Internet to no avail, and I cried to death. But luckily God saved me 555555.

Without further ado, let’s go directly to the reason!

reason:

Same error as I had an article worth 50 before -- JDK版本过高. I believe that careful friends can see the above picture and find that the JDKversion I started is 17, so I always have 404. It really kills me hahaha. Because the latest version JDKwill be incompatible with some framework versions, some error reasons cannot be found at all (thanks I learned the lesson from the last time). So, everyone still uses 1.8the better version 555555.

Configuration to start:

insert image description here

Starting result:

404


Configuration after change:

insert image description here

Changed result:

insert image description here

Note: The above jdkconfigurations are not those, and there are several that need to be changed to 1.8. I'm just giving you an example.


Summary and lessons

This time stepping on the pit is really painful and happy 5555555. I have learned a lot of experience and are familiar with the foundation of MVC, so these experiences are all experiences. I really tried most of the mistakes and changed the version of IDEA hahaha. Really too painful 555. Stop talking, there is a garbled error waiting for me, I am going to change 5555, see you in the next issue! ! !

I tried it all over again, and also changed the version of IDEA hahaha. Really too painful 555. Stop talking, there is a garbled error waiting for me, I am going to change 5555, see you in the next issue! ! !

insert image description here

Guess you like

Origin blog.csdn.net/m0_54355125/article/details/123771782