阿晨1998
如jsp中代码:var xmlhttp;if(window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}else{xmlhttp=new ActiveXObject();}xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4 && xmlhttp.status==200){alert(xmlhttp.responseText);//此处获取返回数据}}xmlhttp.open("GET","service/toupdstatus.htm“,true);xmlhttp.send();后台:HttpServletResponse res=ServletActionContext.getResponse();res.setCharacterEncoding("utf-8");try {res.getWriter().write("Has been successfully changed!");} catch (Exception e) {e.printStackTrace();}到此ok,方法返回类型为void,struts.xml内不用写<result/>标签