核心代码:方法参数要有response
response.setContextType("text/html;charset=UTF-8");
PrintWrite out = response.getWrite();
out.write("<script type=‘text/javascript‘>alert(‘这是一个弹出框!‘);window.close();</script>");
out.flush();
out.close();
时间: 2024-10-20 17:09:01