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:controller.ResultaatController.java

@RequestMapping(method = RequestMethod.GET)
public String doGet(@RequestParam("leerlingId") int id, Model model) {

    Leerling l = klasManager.getLeerling(id);
    model.addAttribute("leerling", l);
    return "resultaatView";
}

From source file:cs425.yogastudio.controller.SectionController.java

@RequestMapping(value = "/sections", method = RequestMethod.GET)
public String getAll(Model model) {
    model.addAttribute("sections", sectionService.getAll());

    return "sectionList";
}

From source file:mx.com.misha.demo.trabajadornomina.controller.TrabajadorController.java

@RequestMapping(value = "/verTrabajadores.do", method = RequestMethod.GET)
public ModelAndView verTrabajadores(Model model) {
    System.out.println("verTrabajadores");

    model.addAttribute("trabajadores", trabajadorService.buscarTrabajadores());
    model.addAttribute("mensaje", "Prueba Spring MVC");

    return new ModelAndView("verTrabajadores");
}

From source file:streaming.controller.GenreController.java

@RequestMapping(value = "ajouter", method = RequestMethod.GET)
public String ajouter(Model model) {
    model.addAttribute("monGenre", new Genre());
    return "genre/ajouterGenre";
}

From source file:com.github.dbourdette.glass.web.controller.LogsController.java

@RequestMapping("/logs/{jobGroup}/{jobName}")
public String logs(@PathVariable String jobGroup, @PathVariable String jobName,
        @RequestParam(defaultValue = "1") int index, Model model) {
    model.addAttribute("page", executions.find(jobGroup, jobName, Query.oneBasedIndex(index)));

    return "logs";
}

From source file:com.nirwansyah.dicka.springboot.controller.ControllerNasabah.java

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

    model.addAttribute("title", "Insert Nasabah");
    return "nasabah/insert";
}

From source file:com.solutiondesign.rss.controller.RssEditController.java

@RenderMapping
public String edit(RenderRequest request, Model model) {
    model.addAttribute("allowLabel", preferenceService.allowUserFeeds(request) ? DISALLOW : ALLOW);
    model.addAttribute("showActivities", preferenceService.showActivities(request) ? DISALLOW : ALLOW);
    return "edit-global";
}

From source file:net.rgielen.actionframeworks.springmvc.controller.ActorsController.java

@RequestMapping(method = GET)
public String actors(Model model) {
    model.addAttribute("actors", actorService.findAll());
    return "actors";
}

From source file:net.rgielen.actionframeworks.springmvc.controller.ActorsController.java

@RequestMapping(value = "new")
public String showNew(Model model) {
    model.addAttribute("actor", new Actor());
    return "actor";
}

From source file:net.rgielen.actionframeworks.springmvc.controller.ActorsController.java

@RequestMapping(value = "{id}")
public String show(@PathVariable String id, Model model) {
    model.addAttribute("actor", actorService.findById(id));
    return "actor";
}