update更新失败

longzl123 2014-04-01 08:43:09
// 进行修改
public String updateCompany() {
// 修改
try {
TEmployee employee = (TEmployee) request.getSession().getAttribute(
"employee");
if (employee != null) {
companyInfo.setStatus(1);
Integer countsPrice = (Integer) request.getSession()
.getAttribute("countsPrice");
companyInfo.setEmpId(employee.getEmpId());
companyInfo.setSolutionPrice(String.valueOf(countsPrice));
companyInfoBiz.updateCompany(companyInfo);
// 清空companyInfo内容 进行首页查询
this.request.setAttribute("message", "修改成功");
// 在页面显示修改后信息
request.setAttribute("company", companyInfo);
// url = "/WEB-INF/company/switch.jsp";
// return Action.SUCCESS;
} else {
this.request.setAttribute("message", "登录超时");
}

} catch (Exception e) {
this.request.setAttribute("message", "修改失败,请重试!");
e.printStackTrace();
}
if (companyInfo != null) {
companyInfo = null;
}
url = "/WEB-INF/company/companyList.jsp";
return getCompanyListFromRole();

}
为什么注掉 // url = "/WEB-INF/company/switch.jsp";
// return Action.SUCCESS;更新就成功了 否则失败
...全文
78 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
别闹腰不好 2014-04-02
  • 打赏
  • 举报
回复
你的修改失败是从页面上看到的,还是从库里看到的。 我觉得真正的更新失败还是成功要看看库才知道。

10,606

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 其他
社区管理员
  • 其他
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧