Package org.springframework.ui

Examples of org.springframework.ui.ModelMap.addAttribute()


  @NavigationMapping
  public NavigationOutcome onSubmitReview(Hotel hotel, ReviewDetails details) {
    /* Review review = */this.hotelService.addReview(hotel, details);
    // FIXME put something in flash scope to be displayed on hotel screen
    ModelMap model = new ExtendedModelMap();
    model.addAttribute("country", hotel.getCity().getCountry());
    model.addAttribute("city", hotel.getCity().getName());
    model.addAttribute("hotel", hotel.getName());
    return new NavigationOutcome("@hotel", model);
  }

View Full Code Here


  public NavigationOutcome onSubmitReview(Hotel hotel, ReviewDetails details) {
    /* Review review = */this.hotelService.addReview(hotel, details);
    // FIXME put something in flash scope to be displayed on hotel screen
    ModelMap model = new ExtendedModelMap();
    model.addAttribute("country", hotel.getCity().getCountry());
    model.addAttribute("city", hotel.getCity().getName());
    model.addAttribute("hotel", hotel.getName());
    return new NavigationOutcome("@hotel", model);
  }

  private Hotel getHotel(String country, String cityName, String hotelName) {
View Full Code Here

    /* Review review = */this.hotelService.addReview(hotel, details);
    // FIXME put something in flash scope to be displayed on hotel screen
    ModelMap model = new ExtendedModelMap();
    model.addAttribute("country", hotel.getCity().getCountry());
    model.addAttribute("city", hotel.getCity().getName());
    model.addAttribute("hotel", hotel.getName());
    return new NavigationOutcome("@hotel", model);
  }

  private Hotel getHotel(String country, String cityName, String hotelName) {
    City city = this.cityService.getCity(cityName, country);
View Full Code Here

    }

    ModelMap result = new ModelMap();
    EditBoxesRequest form = new EditBoxesRequest();
    form.setPosition(pos);
    result.addAttribute("form", form);
    return result;
  }

  @RequestMapping(value = "/remove-box.jsp", method = RequestMethod.POST)
  public String doRemove(@ModelAttribute("form") EditBoxesRequest form, BindingResult result,
View Full Code Here

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        if (modelAndView != null) {
            ModelMap map = modelAndView.getModelMap();
            map.addAttribute(ModelKeys.PORTAL_SETTINGS, preferenceService.getPreferencesAsMap());
            map.addAttribute(ModelKeys.STATIC_CONTENT_CACHE, staticContentFetcherService);
        }
        super.postHandle(request, response, handler, modelAndView);
    }
}
View Full Code Here

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
        if (modelAndView != null) {
            ModelMap map = modelAndView.getModelMap();
            map.addAttribute(ModelKeys.PORTAL_SETTINGS, preferenceService.getPreferencesAsMap());
            map.addAttribute(ModelKeys.STATIC_CONTENT_CACHE, staticContentFetcherService);
        }
        super.postHandle(request, response, handler, modelAndView);
    }
}
View Full Code Here

    Writer stringWriter = new StringWriter();
    PrintWriter printWriter = new PrintWriter(stringWriter);
    ex.printStackTrace(printWriter);
   
    ModelMap model = new ModelMap();
    model.addAttribute("error", ex);
    model.addAttribute("stackTrace", stringWriter.toString());
    return new ModelAndView("/error", model);
  }
 
  @ExceptionHandler(Exception.class)
View Full Code Here

    PrintWriter printWriter = new PrintWriter(stringWriter);
    ex.printStackTrace(printWriter);
   
    ModelMap model = new ModelMap();
    model.addAttribute("error", ex);
    model.addAttribute("stackTrace", stringWriter.toString());
    return new ModelAndView("/error", model);
  }
 
  @ExceptionHandler(Exception.class)
  public ModelAndView handleException(Exception ex) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.