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; -.-!!! 

你可能感兴趣的:(action)