@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// 。。。。处理[添加一些参数]
resp.setContentType("text/html;charset=utf-8");
req.setCharacterEncoding("utf-8");
String name = req.getParameter("name");
PrintWriter writer = resp.getWriter();
name = new String(name.getBytes("ISO-8859-1"), "utf-8");
String txt = "测试成功";
writer.print(txt);
}
时间: 2024-10-26 03:03:10