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.
*/
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 =
""-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n";
out.println(docType +
"\n" +
"
\n" +
"\n" +
"
Hello WWW
\n" +
"");
}
}
学无止境,想要写好一门代码,就得从最基本的开始学起,只要一步一步脚踏实地就能学好,小编在爱站技术频道整理了很多文章,感兴趣的可以了解下。