The javaweb project written by IDEA did not report an error after starting, and the front-end access 404

I encountered a strange problem when I was writing the project today. After starting the ssm project with idea, no error was reported in the backend. No matter how the front-end requested it, it was 404, and I couldn't access any static resources of the project.

  1. First of all, I suspect that there is a problem with the configuration. Baidu has some interceptor configuration problems. The project has not been deployed to tomcat, and the access path has been ruled out or it has not been resolved.
  2. It can only be a big move. I will put the project into a war package and put it directly on tomcat for deployment and operation, start tomcat, and ok the perfect access to the page. This proves that my project configuration is fine.
  3. The basic locking problem is the configuration of the idea. Later I found out that I was too careless to configure an application context for tomcat (the default access path of the web project)Insert picture description here
    Insert picture description here

After adding this default access path, the access address of the project is not localhost:8080/, it
should be changed to localhost:8080/mvc-test. I usually only fill in one/so visit. When I found bugs for my classmates today, I never suspected that this was the problem. Change the project configuration to Doubtful Life, the page is still 404.

  1. I hope to help Xiaobai who is novice like me and avoid spending a lot of time on such small problems.

Guess you like

Origin blog.csdn.net/u013456390/article/details/105754158