AJAX知识总结

来源:互联网 发布:域名企业代备案 编辑:程序博客网 时间:2024/05/20 19:17

1.AJAX用法

var xmlHTTP = new ActiveXObject("Msxml2.XMLHTTP");

xmlHTTP.open("POST","corpAction.do?todo=getCorpInfo&mainCorpNo="+mainCorpNo,false);

xmlHTTP.send(null);

var result = xmlHTTP.responseText;

var resultArray=result.split("|");

 

public ActionForward getUserCode(ActionMapping mapping, ActionForm form,

HttpServletRequest request, HttpServletResponse response)

throws EbillsException, IOException {

try {

String userCode = request.getParameter("userCode");

int result = 0;

if (!"".equals(userCode)) {

//Corp corp = this.getParameterManager().getCorpCoreInfo(mainCorpNo,"0");//无锡

User user = this.getSecurityManager().getUserByUserCode(userCode);

if(null != user && !"".equals(user)){

result = 0;

}else{

result = 1;

}

}

response.setContentType("text/html;charset=GBK");

response.getWriter().write(result);

} catch (Exception ex) {

response.setContentType("text/html;charset=GBK");

response.getWriter().write("fail," + ex);

throw new EbillsException("获取用户信息失败:"+ex);

}

return null;

 

}

原创粉丝点击