code059.java
package pack01;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class code059 extends HttpServlet
{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html");
response.setCharacterEncoding("utf-8");
PrintWriter writer1 = response.getWriter();
writer1.println("<html>");
writer1.println("<head><title>Servletʵ��</title></head>");
writer1.println("<body>");
writer1.print("Servletʵ����");
writer1.println(this.getClass());
writer1.println("</body>");
writer1.println("</html>");
writer1.flush(); //��������ִ��
writer1.close();
}
//���д��࣬������tomcat��������web.xml�ļ�������servlet��
/*
* �������
*
*<servlet>
* <servlet-name>code059</servlet-name>
* <servlet-class>pack01.code059</servlet-class> //�����ĸ���
*</servlet>
*<servlet-mapping>
* <servlet-name>code059</servlet-name> //�������Ϸ���һ��
* <url-pattern>/servlet/pack01.code059</url-pattern> // ���������·��
*</servlet-mapping>
*</web-app>
*/
}