标准Servlet
[java] view plaincopy
- package com.myHelloWorld;
- 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 HelloWorld extends HttpServlet {
- public void doGet(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException {
- PrintWriter out = response.getWriter();
- out.write("<html> ");
- out.write("<head> ");
- //�趨���뷽ʽ 将夜 www.jiangyea.com
- out.write("<meta http-equiv="Content-Type" content="text/html; charset=GBK"> ");
- out.write("</head> ");
- out.write(" ");
- out.write("<body> ");
- out.write("<font size=20> ");
- out.print("����Servletʵ��HelloWorld");
- out.write(" ");
- out.write("</font> ");
- out.write("</body> ");
- out.write("</html>");
- }
- }