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:com.lyncode.jtwig.example.controller.IndexController.java

@RequestMapping("/")
public String indexAction(ModelMap model) {
    model.addAttribute("name", "JTwig User");
    return "main/index";
}

From source file:com.mohit.program.controller.disease.DisplayDisease.java

@RequestMapping(method = RequestMethod.GET)
public String doGet(ModelMap map) {
    map.addAttribute("disease", diseaseDao.getAll());
    return "disease/display";
}

From source file:pl.wedjaa.tutorials.examples.config.Main.java

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

    return "index";
}

From source file:com.mohit.program.controller.display.DisplayController.java

@RequestMapping(method = RequestMethod.GET)
public String doGet(ModelMap map) {
    map.addAttribute("medicine", medicineDao.getAll());
    return "display/display";
}

From source file:com.project.framework.controller.FooterController.java

@RequestMapping(value = "/footer", method = { RequestMethod.GET, RequestMethod.POST })
public String setFooter(ModelMap model) {
    model.addAttribute("continentes", continenteService.getContinentesConIdioma());
    return "framework/footer";
}

From source file:org.openmrs.module.dermimage.web.controller.DermimageManageController.java

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

From source file:org.openmrs.module.isanteplusopenmrsintro.web.controller.IsantePlusOmrsIntroManageController.java

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

From source file:org.openmrs.module.ntdhealth.web.controller.NTDHealthapplicationManageController.java

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

From source file:org.openmrs.module.nuform.web.controller.NuformManageController.java

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

From source file:org.openmrs.module.skinhelpdesk.web.controller.SkinHelpDeskManageController.java

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