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.pagecheck.web.controller.CheckController.java

@RequestMapping(method = RequestMethod.GET)
public String showForm(HttpServletRequest request, ModelMap model) {
    Utils.checkSuperUser();//from   w  w  w .jav a2 s.  c  om

    model.addAttribute("task", TaskEngine.getCurrentTask());

    // Developer hack - end users shouldn't be stopping imports once they've started
    if (request.getParameter("stop") != null)
        TaskEngine.stopCurrentTask();

    return "/module/pagecheck/check";
}

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

/**
 * /* ww w . j a va 2  s .  co m*/
 */
@RequestMapping(value = "/add", method = RequestMethod.GET)
public String add(ModelMap model) {
    model.addAttribute("types", Type.values());
    return "/admin/tag/add";
}

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

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

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

/**
 * /* w w  w.java2 s. com*/
 */
@RequestMapping(value = "/edit", method = RequestMethod.GET)
public String edit(Long id, ModelMap model) {
    model.addAttribute("types", Type.values());
    model.addAttribute("tag", tagService.find(id));
    return "/admin/tag/edit";
}

From source file:org.openmrs.module.drawing.web.controller.ManageTemplatesController.java

@RequestMapping(value = "/module/drawing/manageTemplates", method = RequestMethod.GET)
public void manage(ModelMap model) {
    model.addAttribute("encodedTemplateNames", DrawingUtil.getAllTemplateNames());
}

From source file:org.openmrs.module.privilegehelper.web.controller.PrivilegeLoggerController.java

@RequestMapping(value = "/log", method = RequestMethod.GET)
public void log(ModelMap model) {
    model.addAttribute("currentUser", Context.getAuthenticatedUser());
    model.addAttribute("loggedUsers", logger.getLoggedUsers());
}

From source file:org.openmrs.module.privilegehelper.web.controller.PrivilegeLoggerController.java

public void populateModelForLoggedPrivileges(User user, List<PrivilegeLogEntry> loggedPrivileges,
        ModelMap model) {
    model.addAttribute("user", user);
    model.addAttribute("loggedPrivileges", loggedPrivileges);
    model.addAttribute("loggingPrivileges", logger.isLoggingPrivileges(user));
}

From source file:cn.hbu.cs.esearch.controller.EsearchController.java

@RequestMapping(value = { "index", "/" }, method = { RequestMethod.GET, RequestMethod.HEAD })
public String indexPage(ModelMap modelMap) {
    modelMap.addAttribute("isSearchRequest", false);
    return "index";
}

From source file:cn.hbu.cs.esearch.controller.EsearchController.java

@RequestMapping(value = "how", method = { RequestMethod.GET, RequestMethod.HEAD })
public String howPage(ModelMap modelMap) {
    modelMap.addAttribute("isSearchRequest", false);
    return "how";
}

From source file:cn.hbu.cs.esearch.controller.EsearchController.java

@RequestMapping(value = "api", method = { RequestMethod.GET, RequestMethod.HEAD })
public String apiPage(ModelMap modelMap) {
    modelMap.addAttribute("isSearchRequest", false);
    return "api";
}