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.barebones.web.controller.BarebonesModuleManageController.java

@RequestMapping(value = "/module/barebones/manage", method = RequestMethod.GET)
public void manage(ModelMap model) {
    model.addAttribute("user", Context.getAuthenticatedUser());
    //model.put("vaccines", Context.getService(VaccinesService.class).getAllVaccines(false));
    //model.put("barebones", Context.getService(BarebonesService.class).combineVaccinesAndBarebonesByPatientId(3));
}

From source file:springku.HelloController.java

@RequestMapping(value = "/belajar/{param:.+}/{pesan:.+}", method = RequestMethod.GET)
public String belajar(@PathVariable("param") String param, @PathVariable("pesan") String pesan, ModelMap map) {
    map.addAttribute("nama", param);

    map.addAttribute("pesan", pesan);
    return "learning";
}

From source file:com.garethahealy.eap.frontend.MeController.java

@RequestMapping(value = "/me")
public ModelAndView index() {
    ModelMap model = new ModelMap();
    model.addAttribute("personname", "Gareth");

    return new ModelAndView("site/me", model);
}

From source file:org.openmrs.module.barebones.web.controller.BarebonesModuleManageController.java

@RequestMapping(value = "/module/barebones/barebonesPage", method = RequestMethod.GET)
public void barebonesPageController(@RequestParam(required = false, value = "retroactive") String retroactive,
        ModelMap model) {
    model.addAttribute("user", Context.getAuthenticatedUser());
    model.addAttribute("DO_NOT_INCLUDE_JQUERY", true);
    model.addAttribute("retroactive", retroactive);
}

From source file:app.controllers.OwnersController.java

@RequestMapping(method = GET)
public String index(ModelMap model) {
    model.addAttribute("owners", ownerService.getAllOwners());
    return "owners/index";
}

From source file:com.lyncode.dataencoder.controller.IndexController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String indexAction(ModelMap modelMap) {
    modelMap.addAttribute("keys", repository.findAll());
    return "index";
}

From source file:com.rplt.studioMusik.controller.HomeController.java

@RequestMapping(value = "loginmember", method = { RequestMethod.GET, RequestMethod.POST })
public String loginMember(@RequestParam("username") String username, @RequestParam("password") String password,
        ModelMap model) {
    model.addAttribute("username", username);
    model.addAttribute("password", password);
    return "redirect:/loginmember";
}

From source file:com.rplt.studioMusik.controller.HomeController.java

@RequestMapping(value = "login", method = { RequestMethod.GET, RequestMethod.POST })
public String loginPegawai(@RequestParam("username") String username, @RequestParam("password") String password,
        ModelMap model) {
    model.addAttribute("username", username);
    model.addAttribute("password", password);
    return "redirect:/login";
}

From source file:net.groupbuy.controller.admin.RefundsController.java

/**
 * //ww  w . ja v  a  2  s.c  om
 */
@RequestMapping(value = "/view", method = RequestMethod.GET)
public String view(Long id, ModelMap model) {
    model.addAttribute("refunds", refundsService.find(id));
    return "/admin/refunds/view";
}

From source file:net.groupbuy.controller.admin.RefundsController.java

/**
 * /*  ww w.  jav a2s.c  o  m*/
 */
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Pageable pageable, ModelMap model) {
    model.addAttribute("page", refundsService.findPage(pageable));
    return "/admin/refunds/list";
}