jsp源码实例1(输出)

js

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>");
}
}

时间: 2024-10-08 12:29:37

jsp源码实例1(输出)的相关文章

jsp源码实例1(输出)_JSP编程

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.corese

jsp源码实例5(cookie)

cookie|js package coreservlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** Sets six cookies: three that apply only to the current * session (regardless of how long that session lasts) * and three that persist for an ho

jsp源码实例4(搜索引擎)

js|搜索引擎 package coreservlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; public class SearchEngines extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throw

jsp源码实例2(获取表单参数)

js package coreservlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; /** Shows all the parameters sent to the servlet via either * GET or POST. Specially marks parameters that have * no values or multipl

jsp源码实例3(获取jsp各种参数)

js package coreservlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; /** Creates a table showing the current value of each * of the standard CGI variables. * <P> * Taken from Core Servlets and JavaServe

jsp源码实例

js package coreservlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.net.*; public class SearchEngines extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws Ser

jsp源码实例3(获取jsp各种参数)_JSP编程

package coreservlets; import java.io.*;import javax.servlet.*;import javax.servlet.http.*;import java.util.*; /** Creates a table showing the current value of each* of the standard CGI variables.* <P>* Taken from Core Servlets and JavaServer Pages*

jsp源码实例5(cookie)_JSP编程

package coreservlets; import java.io.*;import javax.servlet.*;import javax.servlet.http.*; /** Sets six cookies: three that apply only to the current* session (regardless of how long that session lasts)* and three that persist for an hour (regardless

安卓开发中Bitmap源码实例

 安卓开发中Bitmap源码实例 package android.graphics; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.io.InputStream; import javax.imageio.ImageIO; public final class Bitmap extends _Original_Bitmap { private Bu