一般来说,sevlet是要充当控制器,实现页面的跳转,不推荐这样用,上述的功能实现大致为:在servlet中输出js代码,如:PrintWriter out=res.getWriter();String a="