更新某个对象时:
// 发布
public String issue() throws Exception {
String defineId = super.getRequest().getParameter("defineId");
try {
boolean isSuccess = false;
// 修改
if (defineId != null && !Utility.isEmpty(defineId)) {
//更新某个字段时,先清空对象。
fmDefine = new FmDefine();
fmDefine.setDefineId(defineId);
fmDefine.setState("已发布");
isSuccess = fmDefineBO.update(fmDefine);
}
if (isSuccess) {
super.addActionMessage("发布成功!");
} else {
super.addActionMessage("保存失败!");
}
// super.getRequest().setAttribute("isSuccess", isSuccess);
} catch (Exception e) {
e.printStackTrace();
}
return query();
}