日期:2014-05-16 浏览次数:21059 次
package test; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import static java.lang.System.out; public class HelloServlet extends HttpServlet { public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html><head><title>This is my first Servlet</title></head>"); out.println("<body><div align='center' style='text-align:center;display:block;width:200px;height:30px;border:1px solid #ff00ff;'>"); out.println("Hello,Servlet World!</div></body></html>"); } } /** *2010-5-2 07:29:18 *Conclusion: */