/** * view KbDiseaseFull need give parmeter id get id from modle, * * @return */ public String viewKbDiseaseFull() { try { int getId = kbDisease.getId(); log.info(this.logprefix + ";id=" + getId); if (getId < 0) { log.error("error,id小于0不规范"); return "error"; } KbDiseaseFull temKbDiseaseFull = kbDiseaseService.selectKbDiseaseFullById(getId); if (temKbDiseaseFull != null) { BeanUtils.copyProperties(kbDiseaseFull, temKbDiseaseFull); return SUCCESS; } else { log.error("error,查询实体不存在。"); return "Error"; } } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } return "Error"; }
/** 编辑实体Full action的方法,首先获取entityfull的信息,返回到编辑页面 */ public String editKbDiseaseFull() { log.info(logprefix + "viewKbDisease"); try { if (kbDisease.getId() != null && kbDisease.getId() > 0) { KbDiseaseFull temKbDiseaseFull = kbDiseaseService.selectKbDiseaseFullById(kbDisease.getId()); BeanUtils.copyProperties(kbDiseaseFull, temKbDiseaseFull); actionMsg = getText("selectKbDiseaseByIdSuccess"); } else { actionMsg = getText("selectKbDiseaseByIdFail"); System.out.println(actionMsg); } return SUCCESS; } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); log.error("类KbDiseaseAction的方法:selectKbDiseaseFullById错误" + e); } return "error"; }