📄 responseservlet.java
字号:
/*
* SimpleServlet.java
*
* Created on October 7, 2002, 10:51 PM
*/
/*
* Simple servlet that generates HTML.
*
*/
package jwadbook.servlets;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
/**
*
* @author Jian Cai
*/
public class ResponseServlet extends HttpServlet {
public void init() throws ServletException {
}
public void doGet ( HttpServletRequest req, HttpServletResponse resp )
throws ServletException,IOException
{
PrintWriter out = resp.getWriter();
resp.setContentType("text/html");
out.println(" <HTML> ");
out.println(" <HEAD>");
out.println(" <TITLE> Simple Servlet </TITLE> ");
out.println(" </HEAD> ");
out.println(" <BODY BGCOLOR=white> ");
out.println(" <CENTER> ");
out.println(" <FONT COLOR=BLACK SIZE='5'> ");
out.println(" <STRONG> I know filter!</STRONG> ");
out.println(" This is from ResonseServlet");
out.println(" </FONT> ");
out.println(" </CENTER> ");
//out.println(" </BODY> ");
//out.println(" </HTML> " );
//out.flush();
}
public void doPost ( HttpServletRequest req, HttpServletResponse resp )
throws ServletException,IOException
{
doGet(req, resp);
}
public void destroy() {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -