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.groovy.web.controller.GroovyReportFormController.java

@RequestMapping(method = RequestMethod.GET)
public String listReports(ModelMap map) {
    map.addAttribute("scripts", GroovyUtil.getService().getAllScripts());
    map.addAttribute("output", null);
    map.addAttribute("error", null);

    log.info("get groovy reports");
    return view;//from ww  w .  j a  v a2  s . c om
}

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

@RequestMapping(value = { "/clone/{id}", "/clone/{id}/" }, method = RequestMethod.GET)
@SiteTitle("{entity.configuration.clone}")
public ModelAndView cloneConfiguration(@PathVariable Long id) {
    ModelMap mm = new ModelMap();
    mm.addAttribute("configurationForm",
            mapper.map(configurationService.getConfigurationByID(id), ConfigurationForm.class));

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

From source file:org.openmrs.module.urandumodule.web.controller.UranduModuleManageController.java

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

From source file:com.citrix.cpbm.portal.fragment.controllers.AbstractStaticPagesController.java

@RequestMapping(value = "/pages/help", method = RequestMethod.GET)
public String help(ModelMap map) {
    logger.debug("### In help()  start method...");
    map.addAttribute("tenant", getTenant());
    logger.debug("### In help()  end");
    return "main.help";
}

From source file:com.soltec.mmc.controllers.RegistrarCuentaController.java

@RequestMapping(value = "registrar_cuenta", method = RequestMethod.GET)
public String showForm(ModelMap model) {
    nuevaCuenta = new ModeloRegistroCuenta();
    model.addAttribute("CUENTA", nuevaCuenta);
    return "registrar_cuenta";
}

From source file:com.soltec.mmc.controllers.RegistrarCuentaController.java

@RequestMapping(value = "registrar_artista", method = RequestMethod.GET)
public String showFormArtista(ModelMap model) {
    nuevaCuenta = new ModeloRegistroCuenta();
    model.addAttribute("CUENTA_ARTISTA", nuevaCuenta);
    return "registrar_artista";
}

From source file:io.github.autsia.crowly.controllers.DashboardController.java

@RequestMapping(value = "/home", method = RequestMethod.GET)
public String home(ModelMap model) {
    model.addAttribute("title", "Home");
    model.addAttribute("navbar_home", "active");
    return "home";
}

From source file:io.github.autsia.crowly.controllers.DashboardController.java

@RequestMapping(value = "/users", method = RequestMethod.GET)
public String users(ModelMap model) {
    model.addAttribute("title", "Users");
    model.addAttribute("navbar_users", "active");
    return "users";
}

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

/**
 * /*from   w  w  w . jav  a  2s  .com*/
 */
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Pageable pageable, ModelMap model) {
    model.addAttribute("page", adService.findPage(pageable));
    return "/admin/ad/list";
}

From source file:com.healthcit.cacure.web.controller.FormLibraryFormEditController.java

@ModelAttribute
public void populateModelWithAttributes(@RequestParam(value = "id", required = false) Long id,
        @RequestParam(value = "moduleId", required = false) Long moduleId, ModelMap modelMap) {
    modelMap.addAttribute(MODULE_ID_NAME, moduleId);
    FormLibraryForm form = null;//from  w w  w  . j  a  v a  2  s . c o m
    if (id == null) {
        FormLibraryModule module = (FormLibraryModule) moduleMgr.getModule(moduleId);
        form = new FormLibraryForm();
        form.setModule(module);
    } else {
        form = (FormLibraryForm) formManager.getForm(id);
    }
    modelMap.addAttribute(COMMAND_NAME, form);
}