添加代码:PrintWriter out = response.getWriter();
支持中文:response.setContentType("text/html;charset=utf-8");
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=utf-8");
out.println("<h1>您好,我叫张荟子</h1>");
}
eclipse 执行out.request()方法提示out cannot be resolved
原文:http://www.cnblogs.com/huiziz/p/5636155.html