Home > Back-end >  The first servlet, has been 404 problems
The first servlet, has been 404 problems

Time:11-28

The problems have been , strives for the bosses to solve

The web.xml configuration
<? The XML version="1.0" encoding="utf-8"?>
WebFirst


HelloWord

Cn. Itcast. Firstmyapp. Servlet. HelloWordServlet



HelloWord
/hello




Index. Html
Index. Htm
Index. Jsp
Default. Html
Default. Htm
Default. Jsp



============================================

The code

Package cn. Itcast. Firstmyapp. Servlet;

import java.io.IOException;
Import the Java. IO. PrintWriter;

The import javax.mail. Servlet. GenericServlet;
The import javax.mail. Servlet. ServletException;
The import javax.mail. Servlet. ServletRequest;
The import javax.mail. Servlet. ServletResponse;

Public class HelloWordServlet extends GenericServlet {

@ Override
Public void service (ServletRequest arg0, ServletResponse response) throws ServletException, IOException {

System. Out. Println (" accepted the client's request -- -- -- -- -- -- -- -- -- -- -- -- -- ");

PrintWriter pw=response. GetWriter ();
Pw. Print (" Hello Word ");


}

}

CodePudding user response:

Access path is what, you start to 404 is very normal, you don't have a custom page

CodePudding user response:

Find, poor access path file name
  • Related