Example usage for org.springframework.ui ModelMap addAllAttributes

List of usage examples for org.springframework.ui ModelMap addAllAttributes

Introduction

In this page you can find the example usage for org.springframework.ui ModelMap addAllAttributes.

Prototype

public ModelMap addAllAttributes(@Nullable Map<String, ?> attributes) 

Source Link

Document

Copy all attributes in the supplied Map into this Map .

Usage

From source file:com.apress.progwt.server.web.controllers.ControllerUtil.java

public static ModelMap getModelMap(HttpServletRequest req, UserService userService) {
    ModelMap rtn = new ModelMap();
    rtn.addAllAttributes(getDefaultModel(req, userService));
    return rtn;// w  ww. j  a v a 2  s  . co m
}

From source file:com.apress.progwt.server.web.controllers.ControllerUtil.java

public static void updateModelMapWithDefaults(ModelMap map, HttpServletRequest req, UserService userService) {
    map.addAllAttributes(getDefaultModel(req, userService));
}

From source file:ru.codemine.ccms.router.ReportsRouter.java

@Secured("ROLE_OFFICE")
@RequestMapping(value = "/reports/shopproviders", method = RequestMethod.GET)
public String getShopProvidersReport(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("allshops", shopService.getAll());

    return "reports/shopprov";
}

From source file:ru.codemine.ccms.router.ActionEventsRouter.java

@RequestMapping(value = "/actions/create", method = RequestMethod.GET)
public String newActionFrm(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());
    model.addAttribute("allShops", shopService.getAllOpen());
    model.addAttribute("newActionFrm", new ActionEvent(employeeService.getCurrentUser()));

    return "pages/actions/newaction";
}

From source file:ru.codemine.ccms.router.ActionEventsRouter.java

@RequestMapping(value = "/actions/currentFuture", method = RequestMethod.GET)
public String getCurrentFuture(ModelMap model) {
    model.addAllAttributes(utils.prepareModel());

    List<ActionEvent> currentFutureActions = actionEventService.getCurrentFuture();
    model.addAttribute("currentFutureActions", currentFutureActions);

    return "pages/actions/currentFuture";

}

From source file:com.asual.summer.sample.web.TechnologyController.java

@RequestMapping("/add")
public ModelAndView add() {
    ModelMap model = new ModelMap();
    model.addAllAttributes(Arrays.asList(new Technology(), License.list(), Status.list()));
    return new ModelAndView("/add", model);
}

From source file:org.obp.web.SimpleController.java

@RequestMapping("/simple/map")
public String map(ModelMap model) {
    model.addAllAttributes(obp.resolveReadouts(LATITUDE, LONGITUDE));
    model.addAttribute("localName", obp.getName());
    model.addAttribute("localDescription", obp.getDescription());
    return "simple/map-ecc";
}

From source file:org.obp.web.SimpleController.java

@RequestMapping("/simple/map-gm")
public String mapEcc(ModelMap model) {
    model.addAllAttributes(obp.resolveReadouts(LATITUDE, LONGITUDE));
    model.addAttribute("localName", obp.getName());
    model.addAttribute("localDescription", obp.getDescription());
    return "simple/map-gm";
}

From source file:ru.codemine.ccms.router.ActionEventsRouter.java

@RequestMapping(value = "/actions/create", method = RequestMethod.POST)
public String newAction(@Valid @ModelAttribute(value = "newActionFrm") ActionEvent actionEvent,
        BindingResult result, ModelMap model) {
    if (result.hasErrors()) {
        model.addAllAttributes(utils.prepareModel());
        model.addAttribute("allShops", shopService.getAllOpen());

        return "pages/actions/newaction";
    }/*from  w  w w  . jav a  2s  .  c  o m*/

    actionEvent.setCreator(employeeService.getCurrentUser());

    actionEventService.create(actionEvent);

    return "redirect://actions/currentFuture";
}

From source file:com.asual.summer.sample.web.TechnologyController.java

@RequestMapping("/{value}/edit")
public ModelAndView edit(@PathVariable("value") String value) {
    Technology technology = Technology.find(value);
    if (technology == null) {
        throw new ViewNotFoundException();
    }/*ww  w. j a v  a  2 s .co  m*/
    ModelMap model = new ModelMap();
    model.addAllAttributes(Arrays.asList(technology, License.list(), Status.list()));
    return new ModelAndView("/edit", model);
}