Struts 2 ActionSupportクラスを使用してフロントページにメッセージを渡し、表示を取得

1600 ワード

 /**
  *       
  * 
  * @return
  * @throws Exception
  */
 public String delete() throws Exception {
  
List<String> userIds = new ArrayList<String>();
  for (String id : choose) {
   userIds.add(new Integer(id));
  }
  UserObject userInfo = new UserObject();
  userInfo.setUserIds(userIds);
  tUser.setModifyUser(super.getCurrentUser().getUserId());
  userInfo.setUser(tUser);
  try {
   ServiceProvider.getService(UserService.class).deleteUser(userInfo);
  } catch (BizServiceException e) {
   addActionError(e.getErrorMessage());
  }
   addActionMessage("      !");
   return SUCCESS;
  }

 
フロントページjsp:
 
   

 
   
   highlight("message");  window.setTimeout(function(){document.getElementById("message").style.display="none";}, 2000); 

 
参考資料:
http://blog.csdn.net/titilover/article/details/6792854
http://zgphacker2010.iteye.com/blog/1020527