首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Ajax >

Struts2中的action利用Ajax向页面回来数据,及解决返回的中文乱码

2012-09-10 
Struts2中的action利用Ajax向页面返回数据,及解决返回的中文乱码1,在action中的代码?HttpServletResponse

Struts2中的action利用Ajax向页面返回数据,及解决返回的中文乱码

1,在action中的代码

?

HttpServletResponse response = ServletActionContext.getResponse(); response.setContentType("text/html;charset=utf-8");    response.getWriter().print(str);
?要注意代码顺序

热点排行