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.dnn.controller.LoginController.java

@RequestMapping(value = { "/admin" }, method = RequestMethod.GET)
public String admin(ModelMap model) {
    model.addAttribute("usuario", pegarUsuario());
    return "admin";
}

From source file:com.dnn.controller.LoginController.java

@RequestMapping(value = { "/usuario" }, method = RequestMethod.GET)
public String usuario(ModelMap model) {
    model.addAttribute("usuario", pegarUsuario());
    return "usuario";
}

From source file:org.cleverbus.admin.web.console.ErrorCatalogController.java

@RequestMapping("/" + VIEW_NAME)
public String showErrorCatalog(@ModelAttribute("model") ModelMap model) {

    model.addAttribute("errorCodesCatalog", errorCodesCatalog.getErrorCatalog());
    return VIEW_NAME;
}

From source file:org.openmrs.module.billingmigration.web.controller.billingmigrationManageController.java

@RequestMapping(value = "/module/billingmigration/manage", method = RequestMethod.GET)
public void manage(ModelMap model, HttpServletRequest request) {
    model.addAttribute("user", Context.getAuthenticatedUser());
    log.info("bbbbbbbbbbbbbbbbbbbbbbbbbbooooooooooooooooooooooooooooooooo "
            + request.getParameter("importDate"));
    model.addAttribute("importDate", request.getParameter("importDate"));

}

From source file:com.havoc.hotel.admin.controller.CheckinController.java

@RequestMapping(method = RequestMethod.GET)
public String index(ModelMap map) throws SQLException {
    map.addAttribute("Checkin", checkinDAO.getALL());
    return "admin/checkin/index";
}

From source file:com.mtech.easyexchange.mvc.user.LoginController.java

@RequestMapping(value = "/login/failed", method = RequestMethod.GET)
public String loginFailed(ModelMap model, HttpSession session) {

    model.addAttribute("error", true);
    model.addAttribute("session", session.getAttribute("SPRING_SECURITY_LAST_EXCEPTION"));

    return "user/login";
}

From source file:controller.RecordController.java

@RequestMapping(value = "insert", method = RequestMethod.GET)
public String insert(ModelMap model) {
    model.addAttribute("record", new Record());
    return "admin/insert";
}

From source file:de.berlios.jhelpdesk.web.preferences.NotifyEditController.java

@RequestMapping(value = "/preferences/eventNotify.html", method = RequestMethod.GET)
public String prepareForm(ModelMap map) {
    map.addAttribute("preferences", new EventNotifyPreferences());
    return "preferences/eventNotify";
}

From source file:org.openmrs.module.basicexample.web.controller.openMRSnewManageController.java

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

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

/**
 * /*from  w w  w.  j  av  a  2s  . c  om*/
 */
@RequestMapping(value = "/list", method = RequestMethod.GET)
public String list(Type type, ModelMap model) {
    model.addAttribute("type", type);
    model.addAttribute("types", Type.values());
    model.addAttribute("templates", templateService.getList(type));
    return "/admin/template/list";
}