j2ee背景课件,tomcat配置 http xml jsp servlet

  • t3_230997
    了解作者
  • 14.1MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-05 08:04
    上传日期
html tomact配置web站点 http xml配置 j2ee概述 jsp serlet 两种开发模式
背景课件.rar
内容介绍
import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class SimpleServlet extends HttpServlet { public static final String TITLE = "Test servlet"; //Process the HTTP Get request public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); // get the communication channel with the requesting client PrintWriter out = response.getWriter(); // get the server identification String server = getServletConfig(). getServletContext(). getServerInfo(); // write the data out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">" + "<HTML>" + "<HEAD>" + " <TITLE>" + TITLE + "</TITLE>" + " <META NAME=\"Author\" CONTENT=\"" + server + "\">" + "</HEAD>" + "<BODY BGCOLOR=\"#FFFFFF\">" + " <CENTER>" + " <H1>" + TITLE + "</H1>" + " <H2>Hi, " + server + " is working!</H2>" + " <H3>[ local time is <font color='#FF9900'>" + new java.util.Date() + "</font> ]</H3>" + " </CENTER>" + "</BODY>" + "</HTML>"); } }
评论
    相关推荐