Create a new web_info under MyApps
And then build classes folders and Web.xml files.
Creates a new text file Testservlet, enters the code, and changes the suffix name to. java
Enter Javac C:/tomcat5.0/webapps/myapps/testservlet.java at the command line
There's a mistake, saying you can't find Javax.servlet.
So the common/lib under the Servlet_api.jar to C:/jdk/jre/lib/ext under,
Run Javac again, success.
Add the following code to the Web.xml:
<?xml version= "1.0" encoding= "Iso-8859-1"?>
<! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>my the Examples</display-name>
<description>
My A-Servlet examples!
</description>
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TestServlet</servlet-name>
<url-pattern>/TestServlet</url-pattern>
</servlet-mapping>
</web-app>
Enter Http://localhost:8080/TestServlet in IE
The test did not succeed. reported 404 errors.
Not resolved yet ...