Example usage for org.springframework.ui ModelMap addAttribute

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

Introduction

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

Prototype

public ModelMap addAttribute(String attributeName, @Nullable Object attributeValue) 

Source Link

Document

Add the supplied attribute under the supplied name.

Usage

From source file:org.openmrs.module.openhmis.eventbasedbilling.web.controller.EventBasedBillingOptionsController.java

@RequestMapping(method = RequestMethod.GET)
public void options(ModelMap model) {
    model.addAttribute("options", Context.getService(IEventBasedBillingOptionsService.class).getOptions());
    model.addAttribute("associators", Context.getService(IBillAssociatorDataService.class).getAll());
    model.addAttribute("cashPoints", Context.getService(ICashPointService.class).getAll());
}

From source file:core.controller.DepartemenController.java

@RequestMapping(method = RequestMethod.GET)
public String getAll(ModelMap model) {
    model.addAttribute("departemens", departemenDAO.getAll());
    return "departemen";
}

From source file:pl.lodz.uni.math.controller.HelloController.java

@RequestMapping(method = RequestMethod.GET)
public String printWelcome(ModelMap model) {
    User user = new User("asd");
    model.addAttribute("message", user.getName());
    return "index";
}

From source file:videoshop.controller.BossController.java

@RequestMapping("/customers")
public String customers(ModelMap modelMap) {

    modelMap.addAttribute("customerList", customerRepository.findAll());

    return "customers";
}

From source file:videoshop.controller.BossController.java

@RequestMapping("/orders")
public String orders(ModelMap modelMap) {

    modelMap.addAttribute("ordersCompleted", orderManager.find(OrderStatus.COMPLETED));

    return "orders";
}

From source file:videoshop.controller.BossController.java

@RequestMapping("/stock")
public String stock(ModelMap modelMap) {

    modelMap.addAttribute("stock", inventory.findAll());

    return "stock";
}

From source file:cz.muni.fi.mir.controllers.ApplicationRunController.java

@RequestMapping(value = { "/", "/list", "/list/" }, method = RequestMethod.GET)
@SiteTitle("{entity.appruns.list}")
public ModelAndView list() {
    ModelMap mm = new ModelMap();
    mm.addAttribute("apprunList", applicationRunService.getAllApplicationRunsFromRange(0, 10, false));

    return new ModelAndView("apprun_list", mm);
}

From source file:it.f2informatica.webapp.controller.NavBarController.java

@RequestMapping(value = "/consultant/new-consultant", method = RequestMethod.GET)
public String createConsultant(ModelMap model) {
    model.addAttribute(SessionAttribute.NAVBAR_ITEM_ACTIVE, 2);
    model.addAttribute("consultantModel", consultantService.buildNewConsultantModel());
    return "consultant/consultantForm";
}

From source file:com.test.IndexController.java

@RequestMapping(method = RequestMethod.GET)
public String getConfigView(ModelMap model) {
    model.addAttribute("message", "Hello Spring MVC Framework!");
    return "index";
}

From source file:it.f2informatica.webapp.controller.NavBarController.java

@RequestMapping(value = { "/user", "/users" }, method = RequestMethod.GET)
public String userManagementPage(ModelMap model) {
    model.addAttribute(SessionAttribute.NAVBAR_ITEM_ACTIVE, 1);
    model.addAttribute(SessionAttribute.ROLES, userService.loadRoles());
    model.addAttribute("userModel", userService.buildEmptyUserModel());
    return "user/users";
}