Package rewardsadmin.app

Examples of rewardsadmin.app.Reward


  /**
   * Enapsulates the lgoic to map a row in a ResultSet to a Reward object.
   */
  private static class RewardMapper implements ParameterizedRowMapper<Reward> {
    public Reward mapRow(ResultSet rs, int rowNum) throws SQLException {
      return new Reward(rs.getString(1), rs.getString(2), rs.getString(3), SimpleDate.valueOf(rs.getDate(4)),
          new MonetaryAmount(rs.getDouble(5)));
    }
View Full Code Here


    if (request.getPathInfo().equals("/new")) {
      // forward to a form JSP to start a new reward dialog
      request.getRequestDispatcher("/WEB-INF/customservlet/reward/new.jsp").forward(request, response);
    } else if (request.getPathInfo().startsWith("/show/")) {
      // locate the reward with the confirmation number provided in the request
      Reward reward = rewardLookupService.lookupReward(extractConfirmationNumber(request));
      request.setAttribute("reward", reward);
      // forward to a JSP to show the reward details
      request.getRequestDispatcher("/WEB-INF/customservlet/reward/show.jsp").forward(request, response);
    }
  }
View Full Code Here

    rewardLookupService = (RewardLookupService) getWebApplicationContext().getBean("rewardLookupService");
  }

  public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    Reward reward = rewardLookupService.lookupReward(extractConfirmationNumber(request));
    request.setAttribute("reward", new FormattedReward(reward));
    return actionMapping.findForward("show");
  }
View Full Code Here

   * @param request the request
   * @param response the response
   * @return a selection of the "show" view to render the reward
   */
  public ModelAndView show(HttpServletRequest request, HttpServletResponse response) {
    Reward reward = rewardLookupService.lookupReward(extractConfirmationNumber(request));
    DataBinder binder = new DataBinder(reward, "reward");
    binder.registerCustomEditor(MonetaryAmount.class, new MonetaryAmountEditor());
    binder.registerCustomEditor(SimpleDate.class, new SimpleDateEditor());
    return new ModelAndView("reward/show", binder.getBindingResult().getModel());
  }
View Full Code Here

   * @param model the model map into which the reward object will be stored
   * @return a model and view containing the show view name and the reward object
   */
  @RequestMapping(value="/reward/show/*", method = RequestMethod.GET)
  public ModelAndView show(HttpServletRequest request, ModelMap model) {
    Reward reward = rewardLookupService.lookupReward(extractConfirmationNumber(request));
    WebDataBinder binder = new WebDataBinder(reward, "reward");
    initBinder(binder);
    return new ModelAndView(SHOW_VIEW, binder.getBindingResult().getModel());
  }
View Full Code Here

    if (request.getPathInfo().equals("/new")) {
      // forward to a form JSP to start a new reward dialog
      request.getRequestDispatcher("/WEB-INF/customservlet/reward/new.jsp").forward(request, response);
    } else if (request.getPathInfo().startsWith("/show/")) {
      // locate the reward with the confirmation number provided in the request
      Reward reward = rewardLookupService.lookupReward(extractConfirmationNumber(request));
      request.setAttribute("reward", reward);
      // forward to a JSP to show the reward details
      request.getRequestDispatcher("/WEB-INF/customservlet/reward/show.jsp").forward(request, response);
    }
  }
View Full Code Here

   * @param model the model map into which the reward object will be stored
   * @return a model and view containing the show view name and the reward object
   */
  @RequestMapping(value="/reward/show/*", method = RequestMethod.GET)
  public ModelAndView show(HttpServletRequest request, ModelMap model) {
    Reward reward = rewardLookupService.lookupReward(extractConfirmationNumber(request));
    WebDataBinder binder = new WebDataBinder(reward, "reward");
    initBinder(binder);
    return new ModelAndView(SHOW_VIEW, binder.getBindingResult().getModel());
  }
View Full Code Here

TOP

Related Classes of rewardsadmin.app.Reward

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.