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技術(shù):jsp源碼實(shí)例1(輸出),轉(zhuǎn)載需保留來(lái)源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。