The Servlet in java cannot be accessed after changing its name

##After the Servlet name is changed (Rename), an error is always reported when running.

1. When we first learn Servlet, sometimes we find that there are some mistakes in naming after creating the Servlet file due to carelessness; at this time, we will right-click and select Refactor–>Rename to modify the Servlet file name.
insert image description here

2. I am very happy after the modification is successful, but at this time, I will find that there will always be errors when accessing in the browser. Can't find the problem,
the reason is that using this method to modify the name is only to modify the name of the Servlet. The name in the web.xml file and the name contained in the path have not been modified. So you only need to modify the corresponding name in the web.xml file, and the problem will be solved
insert image description here

Then enter the browser for normal access

Guess you like

Origin blog.csdn.net/GuiMa005/article/details/89383513