jsp源码实例1(输出)_JSP教程-查字典教程网
jsp源码实例1(输出)
jsp源码实例1(输出)
发布时间:2016-12-29 来源:查字典编辑
摘要:packagecoreservlets;importjava.io.*;importjavax.servlet.*;importjavax....

package coreservlets;

import java.io.*;

import javax.servlet.*;

import javax.servlet.http.*;

/** Simple servlet that generates HTML.

* <P>

* Taken from Core Servlets and JavaServer Pages

* from Prentice Hall and Sun Microsystems Press,

* http://www.coreservlets.com/.

* © 2000 Marty Hall; may be freely used or adapted.

*/

public class HelloWWW2 extends HttpServlet {

public void doGet(HttpServletRequest request,

HttpServletResponse response)

throws ServletException, IOException {

response.setContentType("text/html");

PrintWriter out = response.getWriter();

String docType =

"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 " +

"Transitional//EN">n";

out.println(docType +

"<HTML>n" +

"<HEAD><TITLE>Hello WWW</TITLE></HEAD>n" +

"<BODY>n" +

"<H1>Hello WWW</H1>n" +

"</BODY></HTML>");

}

}

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新JSP教程学习
    热门JSP教程学习
    编程开发子分类