Running browser 404 in Tomcat when idea creates Maven project

Time:2020-11-28

When using idea to build Maven entry project for learning, I encountered a puzzling error. I hereby record the following

The complete project structure should be as follows:
Running browser 404 in Tomcat when idea creates Maven project

However, when Tomcat runs the project, it encounters index.jsp Page 404, very confused, but the project creation steps are not right, Tomcat runs well.
Running browser 404 in Tomcat when idea creates Maven project

The reason is that the artifact path of Maven generated by ourselves is wrong, which leads to the failure to find the project (there is an elder brother on the Internet saying that idea uses its own Tomcat configuration by default, while we generally use our own Tomcat configuration).

terms of settlement:

First, open file > project structure:
Running browser 404 in Tomcat when idea creates Maven project

Click artifacts. If not, you can add the following:
Running browser 404 in Tomcat when idea creates Maven project

Integrity should be like this:
Running browser 404 in Tomcat when idea creates Maven project

Click here to open Tomcat configuration:
Running browser 404 in Tomcat when idea creates Maven project

If there are no artifacts, you can add them. If you have added them in the previous step, you can add them directly. Then you can do the following:
Running browser 404 in Tomcat when idea creates Maven project

Run the project and finally Hello world!
Running browser 404 in Tomcat when idea creates Maven project

Recommended Today

Interviewer: young man, what do you think of the principle of distributed system

1 Concept 1.1 model 1.2 copies 1.3 indicators for measuring distributed systems 2. Principle of distributed system 2.1 data distribution 2.2 basic copy agreement 2.3 lease mechanism 2.4 quorum mechanism 2.5 log technology 2.6 two phase submission protocol 2.7 MVCC 2.8 Paxos protocol 2.9 CAP 1 Concept 1.1 model node In a specific project, a […]