struts2 action处理ajax
来源:互联网 发布:网络摄像头软件通用 编辑:程序博客网 时间:2024/04/30 01:59
struts2 通过action类处理ajax
1.不能有返回SUCCESS;
2.不能配置视图;
3.实现ServletResponseAware,用PrintWrite out流写返回数据;
用ajax java后台传回值,包括传json
- public static final void sendAsJson(HttpServletResponse response, String str)
- {
- response.setContentType("application/json;charset=UTF-8");
- if (null != str)
- try {
- response.getWriter().write(str);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- public static final void sendAsText(HttpServletResponse response, String str)
- {
- response.setContentType("text/html;charset=UTF-8");
- if (null != str)
- try {
- response.getWriter().write(str);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
0 0
- struts2 action处理ajax
- struts2 action异常处理
- Struts2 action链式处理
- Struts2 Action处理
- action处理Ajax请求
- struts2 action中使用AJAX
- ajax交互Struts2的action
- ajax请求struts2 中的action
- struts2-Action处理请求参数
- struts2处理ajax请求
- Struts2 处理ajax请求
- struts2的ajax处理
- struts2+jquery ajax中,action的配置
- ajax交互Struts2的action(1)
- Struts2的ResultType和Action处理链
- Struts2的ResultType和Action处理链
- Struts2的ResultType和Action处理链
- Struts2的ResultType和Action处理链
- HDU1232:畅通工程
- Shiro
- QTcpSocket 遇到的问题!
- ubuntu下安装搜狗输入法
- CallContext和多线程
- struts2 action处理ajax
- DBCA创建数据库ORA-01034 ORACLE not available
- Objective-C基础之实例变量的默认值
- oracle安装后plsql 如何寻找tns文件
- EXSI5.5虚拟机还原快照数据恢复案例
- 《MFC Windows程序设计》第18章(2):MFC和COM
- ViewPager+Fragment实现页面切换
- Android操作嵌入式关系型SQLite数据库
- 数据挖掘需要考虑的问题