前台 复制代码 代码如下: <script type="text/javascript"> function func_load_remark(sr_id){ if(sr_id!=){ $getJSON("loadSrRemarkdo?date="+new Date() {srid:sr_id} function(srmain){ $("#bparemark")val(srmainbpa_remark); $("#itdremark")val(srmainitd_remark); $("#bugremark")val(srmainbu_remark); $("#itoremark")val(srmainito_remark); }); }else{ $("#bparemark")val(""); $("#itdremark")val(""); $("#bugremark")val(""); $("#itoremark")val(""); } } function check(){ if($("#srid")val()==""){ alert("请选择SR_ID!"); $("#srid")focus(); return false; } return true; } </script> 后台 复制代码 代码如下: package comaegon_cnoocoaadminaction; import javaioPrintWriter; import javaxservlet import javaxservlet import netsfjsonJSONSerializer; import netsfjsonutilJSONUtils; import orgapachestrutsactionActionForm; import orgapachestrutsactionActionForward; import orgapachestrutsactionActionMapping; import comaegon_cnoocframeworkbaseactionBaseAction; import comaegon_cnoocoaadminserviceUserService; import comaegon_cnoocoaibatistoTuOafSrMainTO; public class LoadSrRemarkAction extends BaseAction{ private UserService userService; public ActionForward executeAction(ActionMapping mapping ActionForm form HttpServletRequest request HttpServletResponse response) throws Exception { String srid=requestgetParameter("srid"); TuOafSrMainTO srMain=userServicegetRemarkBySrId(srid); responsesetContentType("application/json;charset=gbk"); responsesetCharacterEncoding("gbk"); PrintWriter pw = responsegetWriter(); pwwrite(JSONUtilsvalueToString(JSONSerializertoJSON(srMain))); pwflush(); return null; } public void setUserService(UserService userService) { thisuserService = userService; } } |