jsp源码输出实例


jsp源码输出实例

文章插图
jsp源码输出实例

文章插图

package coreservlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/** Simple servlet that generates HTML.
*
* 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.
*/
【jsp源码输出实例】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 =
""Transitional//EN">n";
out.println(docType
"n"
"Hello WWWn"
"n"
"Hello WWWn"
"");
}
}



    推荐阅读