Example usage for org.springframework.ui Model addAttribute

List of usage examples for org.springframework.ui Model addAttribute

Introduction

In this page you can find the example usage for org.springframework.ui Model addAttribute.

Prototype

Model addAttribute(Object attributeValue);

Source Link

Document

Add the supplied attribute to this Map using a org.springframework.core.Conventions#getVariableName generated name .

Usage

From source file:org.jboss.as.quickstarts.spring.controller.LoginController.java

/**
 * <p>Handles GET request to the login page.</p>
 *
 * @param model the page model/*  w w  w  .  j  a v a2s  . co m*/
 *
 * @return the view name
 */
@RequestMapping(method = RequestMethod.GET)
public String loginForm(Model model) {

    model.addAttribute(new UserCredentials());
    return "login";
}

From source file:org.cartno.web.LicenseController.java

@RequestMapping(value = "/license/select", method = RequestMethod.GET)
public void select(Model model) {
    List<Area> area = fetchingService.findAllAreas();
    model.addAttribute(area);
}

From source file:com.springsource.oauthservice.develop.AppController.java

@RequestMapping(value = "/apps/{slug}", method = RequestMethod.GET)
public String view(@PathVariable String slug, Principal user, Model model) {
    model.addAttribute(appRepository.findAppBySlug(user.getName(), slug));
    model.addAttribute("slug", slug);
    return "develop/apps/view";
}

From source file:com.springsource.oauthservice.develop.AppController.java

@RequestMapping(value = "/apps/edit/{slug}", method = RequestMethod.GET)
public String editForm(@PathVariable String slug, Principal user, Model model) {
    model.addAttribute(appRepository.getAppForm(user.getName(), slug));
    model.addAttribute("slug", slug);
    return "develop/apps/edit";
}

From source file:net.noday.d4c.web.SubdomainManager.java

@Override
public String edit(@PathVariable("id") Long id, Model m) {
    m.addAttribute(domainService.get(id));
    return "admin/article/add";
}