structs2在action中输出

折腾了2个小时,NND

ActionContext context = ActionContext.getContext();   
HttpServletResponse response = (HttpServletResponse)context.get(ServletActionContext.HTTP_RESPONSE);   

response.setCharacterEncoding("UTF-8"); 

... 

response.getWriter().print("{success:false,msg:'请正确输入密码'}"); 

return null;//NND主要就是这里

一直在纠结return INPUT; -.-!!! 

原文地址:https://www.cnblogs.com/abinxm/p/1900820.html