jsp源码实例1(输出)
程序员文章站
2024-02-12 09:35:34
package coreservlets;import java.io.*;import javax.servlet.*;import javax.servlet.http...
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>");
}
}
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>");
}
}
上一篇: 眼睛近视怎么办,教你这样恢复视力!
下一篇: Java中实现线程的超时中断方法实例