コード例 #1
0
  @RequestMapping(value = "edit.htm", method = RequestMethod.GET)
  public ModelAndView initEdit(@RequestParam("holidayId") String holidayId) {
    if (logger.isInfoEnabled()) {
      logger.info(this.getClass().toString() + "-EDIT-init");
    }
    ModelAndView mav = new ModelAndView();

    mav.addObject(BuckWaConstants.PAGE_SELECT, BuckWaConstants.LEAVE_INIT);

    BuckWaRequest request = new BuckWaRequest();

    request.put("holidayId", holidayId);

    BuckWaResponse response = yearService.getAll();
    List<Year> years = null;

    if (response.getStatus() == BuckWaConstants.SUCCESS) {
      years = (List) response.getResObj("yearList");

      response = holidayService.getById(request);
      if (response.getStatus() == BuckWaConstants.SUCCESS) {
        Holiday holiday = (Holiday) response.getResObj("holiday");
        mav.addObject("holiday", holiday);
        if (years != null) {
          mav.addObject("yearList", years);
        }
      }
    } else {
      mav.addObject("errorCode", response.getErrorCode());
    }
    mav.setViewName("holidayEdit");

    return mav;
  }