package servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloBeijing extends HttpServlet{

 

//public void init(ServletConfig config) throws ServletException{
// super.init(config);
//}

public void service(HttpServletRequest request,HttpServletResponse response) throws IOException{
  response.setContentType("text/html;charset=gb2312");
  
PrintWriter out=response.getWriter();
   out.println("<html>");
   out.println("<head><title>servlet_hello测试</title></head>");
   out.println("<body>");
   out.println("<h2>汉字</h2>");
   out.println("</body></html>");
}

}

 

 别的估计都不用看了  重点就是红色的两句话

另外  这里有个重点    

这两句话的顺序是不能倒的  一定要这样. 

 

相关文章:

  • 2022-12-23
  • 2021-10-29
  • 2021-12-30
  • 2021-10-03
  • 2022-01-23
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-22
  • 2021-06-24
  • 2022-01-03
  • 2021-12-10
  • 2022-12-23
  • 2021-06-03
相关资源
相似解决方案