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(String attributeName, @Nullable Object attributeValue);

Source Link

Document

Add the supplied attribute under the supplied name.

Usage

From source file:streaming.controller.SerieController.java

@RequestMapping(value = "ajouter", method = RequestMethod.GET)
public String ajouter(Model model) {

    model.addAttribute("maSerie", new Serie());
    return "serie/ajouterSerie";
}

From source file:com.cookbook.Controller.LogoutController.java

@RequestMapping(value = "/logout")
public String index(HttpServletRequest request, Model m) {
    System.out.println("Logout controler");
    m.addAttribute("kontoService", kontoService);
    layout.addServices(m);/*from   w ww  .ja v  a  2  s  .c om*/
    Loger.logger.error("LoginController");
    return "logout";
}

From source file:jpa_bayan.PersonController.java

@RequestMapping(value = "/persons", method = RequestMethod.GET)
public String listPersons(Model model) {
    model.addAttribute("person", new Person());
    model.addAttribute("listPersons", this.personDao.listPersons());

    return "person";
}

From source file:org.snaker.modules.base.web.SurrogateController.java

@RequestMapping(value = "view/{id}", method = RequestMethod.GET)
public String view(@PathVariable("id") String id, Model model) {
    model.addAttribute("surrogate", facets.getSurrogate(id));
    return "snaker/surrogateView";
}

From source file:$.UserAdminController.java

@RequestMapping(value = "update/{id}", method = RequestMethod.GET)
    public String updateForm(@PathVariable("id") Long id, Model model) {
        model.addAttribute("user", accountService.getUser(id));
        return "account/adminUserForm";
    }/*  w  w w .j  a  v a 2 s  .  c om*/

From source file:com.groupon.odo.controllers.ConfigurationController.java

@RequestMapping(value = "/configuration", method = RequestMethod.GET)
public String configurationPage(Model model) {
    logger.info("At configuration");
    model.addAttribute("addPath", new Plugin());
    return "configuration";
}

From source file:de.inovex.liferay.tipsandtricks.actiontest.WhitelistTestController.java

@RenderMapping()
public String viewUpdateSuccessful(final RenderRequest request, final Model model) {
    model.addAttribute("sessionTimestamp", System.currentTimeMillis());
    return VIEW;/*from   w  ww .j a  v a  2s.c  o  m*/
}

From source file:org.snaker.modules.base.web.SurrogateController.java

@RequestMapping(value = "create", method = RequestMethod.GET)
public String create(Model model) {
    model.addAttribute("surrogate", new Surrogate());
    model.addAttribute("processNames", facets.getAllProcessNames());
    return "snaker/surrogateEdit";
}

From source file:org.snaker.modules.base.web.SurrogateController.java

@RequestMapping(value = "update/{id}", method = RequestMethod.GET)
public String edit(@PathVariable("id") String id, Model model) {
    model.addAttribute("surrogate", facets.getSurrogate(id));
    model.addAttribute("processNames", facets.getAllProcessNames());
    return "snaker/surrogateEdit";
}

From source file:applikaasie.domein.artikel.ArtikelController.java

@RequestMapping(value = "/artikelen")
public String artikelList(Model model) {
    model.addAttribute("artikelList", artikelRepository.getAllArtikelen());
    return "artikel/artikelen";
}