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;
}