日期:2014-05-16 浏览次数:20726 次
$.ajax({ type : "POST", url : "getOrgName.action", dataType : "json", data : { retVal : retVal }, success : function(data) { document.getElementById("tbVOrg.orgParName").value = data.orgName; } });
public String getOrgName() throws Exception{ response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); request.setCharacterEncoding("UTF-8"); String retVal=request.getParameter("retVal"); TbVOrg org = orgService.findParBySel(retVal); String orgName=org.getOrgName(); JSONObject json = new JSONObject(); json.put("orgName", orgName); out.println(json.toString()); out.flush(); out.close(); return SUCCESS; }