struts也可以使用ajax异步调用页面局部刷新
2009-06-11 15:41
645 查看
var url = "checkonly.do?cid="+cid;
xmlHttp.open("GET", url, true);
//将状态触发器绑定到一个函数
xmlHttp.onreadystatechange = callbackfunction;
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(null);
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ProcessBean processor = new ProcessBean(getDataSource(request));
String cid = request.getParameter("cid");
PrintWriter out = null;
int responseContext = 0;
try {
out = response.getWriter();
out.println(processor.Checkonly(cid));
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
xmlHttp.open("GET", url, true);
//将状态触发器绑定到一个函数
xmlHttp.onreadystatechange = callbackfunction;
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(null);
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
ProcessBean processor = new ProcessBean(getDataSource(request));
String cid = request.getParameter("cid");
PrintWriter out = null;
int responseContext = 0;
try {
out = response.getWriter();
out.println(processor.Checkonly(cid));
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
相关文章推荐
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法
- HTML中使用Ajax进行局部刷新页面
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(0):目录
- 使用reRender局部刷新的时候,自动调用页面加载时候的js
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(9):服务器端和客户端数据类型的自动转换:DataTable和DataSet
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(9):服务器端和客户端数据类型的自动转换:DataTable和DataSet
- 使用AJAX调用数据库不刷新更新页面问题
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(10):服务器端和客户端数据类型的自动转换:以XML方式序列化数据、小结
- 使用js callback机制实现调用页面局部刷新 推荐
- a标签onClick使用ajax异步刷新时页面整个刷新问题
- 使用jQuery实现Ajax异步提交表单实现局部刷新
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(6):服务器端和客户端数据类型的自动转换:复杂类型
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(7):服务器端和客户端数据类型的自动转换:泛型集合类型
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(10):服务器端和客户端数据类型的自动转换:以XML方式序列化数据、小结
- 省、市、地区三级级联菜单(读数据库那种,Ajax异步调用,局部刷新)
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(4):异步通讯层生成的客户端代理类、使用HTTP GET进行调用
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(1):调用Web Service、调用页面中的类方法
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(1):调用Web Service、调用页面中的类方法(转)
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(6):服务器端和客户端数据类型的自动转换:复杂类型
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(4):异步通讯层生成的客户端代理类、使用HTTP GET进行调用