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:controllers.ImpressionFormController.java

@RequestMapping(value = "/form", method = RequestMethod.GET)
public String createForm(ModelMap model) throws ClassNotFoundException {
    model.addAttribute("impression", new Impression());
    model.addAttribute("impressions", Impression.allImpressions());
    return "form";
}

From source file:csns.web.controller.IndexController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(ModelMap models) {
    models.addAttribute("departments", departmentDao.getDepartments());
    return "index";
}

From source file:info.harmia.polyglot.springapp.mvc.web.controller.DepartmentController.java

@RequestMapping(value = "/departments/", method = RequestMethod.GET)
public String listDepartments(@ModelAttribute("department") DepartmentForm departmentForm, ModelMap model) {
    model.addAttribute("department", departmentForm);
    model.addAttribute("departments", departmentService.listDepartments());
    return "departments";
}

From source file:app.controllers.AccountsController.java

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

From source file:org.openmrs.module.updatecss.web.controller.UpdateCSSManageController.java

@RequestMapping(value = "/module/updatecss/manage", method = RequestMethod.GET)
public void manage(ModelMap model) {
    model.addAttribute("user", Context.getAuthenticatedUser());
}

From source file:core.controller.KategoriController.java

@RequestMapping(method = RequestMethod.GET)
public String getAll(ModelMap model) {
    model.addAttribute("kategoris", kategoriDAO.getAll());
    return "daftar_kategori";
}

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

/**
 * //from   w w w  .ja v a  2  s . co  m
 */
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Pageable pageable, ModelMap model) {
    model.addAttribute("page", logService.findPage(pageable));
    return "/admin/log/list";
}

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

/**
 * /*from w  w  w  . j a  v  a  2  s . co  m*/
 */
@RequestMapping(value = "/view", method = RequestMethod.GET)
public String view(Long id, ModelMap model) {
    model.addAttribute("log", logService.find(id));
    return "/admin/log/view";
}

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

/**
 * /* w  w w. j  a v a2  s .  c  o  m*/
 */
@RequestMapping(value = "/view", method = RequestMethod.GET)
public String view(Long id, ModelMap model) {
    model.addAttribute("payment", paymentService.find(id));
    return "/admin/payment/view";
}

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

/**
 * /*from  ww  w.  j av  a 2  s. c o m*/
 */
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Pageable pageable, ModelMap model) {
    model.addAttribute("page", paymentService.findPage(pageable));
    return "/admin/payment/list";
}