Exception of browser accessing servlet404

* *
Error about creating a servlet when viewed in a browser
**

user initiates a request, which is received by the server, and finds out if the requested resource exists according to the configuration information in the web.xml file. If it does not exist, a 404 error is returned.
After the resource is found (the servlet is found), the servlet object is checked to see if it exists, if not, the object is created, and if it does, the corresponding processing method is executed.
After the execution of the processing method, the processing result will be returned to the Web server. After the Web server carries out relevant processing according to the result, it will be returned to the browser, and the browser will display the corresponding processing result.
————————————————
lution for link
Reasons for appearing:
In 404 because the
in the create project is not changed when buildpath WebContent/WEB – INF/classes
cause no class file
so error
Second, if there is no @WebServlet(“/test”) link, you should configure the web.xml file
in the WebContent/ web-inf directory

<servlet>
    <servlet-name>xxx</servlet-name>
    <servlet-class>day2ByServlet.Servlet$One</servlet-class>
    <init-param>
      <param-name>p</param-name>
      <param-value>xixi</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>xxx</servlet-name>
    <url-pattern>/Servlet$One</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>yyy</servlet-name>
    <servlet-class>day2ByServlet.HttpServlet_two</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>yyy</servlet-name>
    <url-pattern>/ServletTwo</url-pattern>
  </servlet-mapping>

Read More: