action 里边输出JS代码,已经测试成功,解决乱码问题:

HttpServletResponse response = (HttpServletResponse) ServletActionContext.getResponse();  
response.setCharacterEncoding("gb2312"); 
PrintWriter out = response.getWriter(); 
out.println("<script   type=\"text/javascript\"   language=\"javascript\">");   
out.println("alert(\"操作成功!\")");   
out.println("</script>");   
out.close(); return null