A 404 error occurs when eclipse runs the web project

This problem occurred before, and the project did not report an error, but it kept displaying 404 when running, and it took several hours to solve it. I tried various methods and could not solve it. Later, I found a lot of information and finally solved it. Let me share my method with you:

Solution:
1. Check the web.xml file in the server.
The opening process is shown in the figure
insert image description here
insert image description here

After opening, find 108 lines of servlet tags (the number of individual lines may be different), the
insert image description here
<param-value>default value is false, change false to true (the purpose of doing this here is to automatically list the files under the project), re-run, after running This interface will appear:

insert image description here
Click the jsp file to open the jsp page.

2. Modify the web.xml file in the WEB-INF directory of the project, add <welcome-file>readme.jsp</welcome-file>(add the corresponding file name, mine is readme) as shown in the figure:

insert image description here

After modification, re-run the project to directly open the jsp file in the webcontent directory.

Guess you like

Origin blog.csdn.net/m0_57968978/article/details/124201354