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:rd.kpath.facebook.FacebookPhotosController.java

/**
 * Get all album related details. Tags friends and so on
 * @param model/*w w  w  .  j  ava 2s  . com*/
 * @return
 */
@RequestMapping(value = "/facebook/albums", method = RequestMethod.GET)
public String showAlbums(Model model) {
    model.addAttribute("albums", facebook.mediaOperations().getAlbums());
    return "facebook/albums";
}

From source file:com.epam.ipodromproject.controller.RegisterCompetitionResultsController.java

@RequestMapping(value = "getCompetitionsToRegisterPage", method = RequestMethod.GET)
public String getCompetitionsByPage(@RequestParam("page") Integer page,
        @RequestParam("resultsPerPage") Integer resultsPerPage, Model model) {
    model.addAttribute("competitions", competitionService.getUnregisteredCompetitions(page, resultsPerPage));
    model.addAttribute("firstNumber", (page - 1) * resultsPerPage);
    return "lists/competitionsToRegisterDropList";
}

From source file:com.flexion.demo.mvc.controller.HomeController.java

/**
 * Simply selects the home view to render by returning its name.
 *///from www. ja  va2s  .  c om
@RequestMapping(value = "/")
public String home(Model model) {

    model.addAttribute("processed", processed);
    return "home";
}

From source file:com.weib.spittr.web.SpittleController.java

@RequestMapping(value = "/spittle_page", method = GET)
public String spittles(@RequestParam(value = "max", defaultValue = "1000") long max,
        @RequestParam(value = "count", defaultValue = "10") int count, Model model) {
    model.addAttribute("spittleList", this.spittleRepository.findSpittles(max, count));
    model.addAttribute("max", max);
    model.addAttribute("count", count);
    return "spittle_page"; //??
}

From source file:kievreclama.task.controllers.CompamyComtroler.java

@RequestMapping(value = "/")
public String getPagesCompany(Model model) {
    model.addAttribute("company", companyService.getList("company"));
    return "company";
}

From source file:rd.kpath.facebook.FacebookPhotosController.java

/**
 * Get individual album by id/*www .ja va  2  s . com*/
 * @param albumId
 * @param model
 * @return
 */
@RequestMapping(value = "/facebook/album/{albumId}", method = RequestMethod.GET)
public String showAlbum(@PathVariable("albumId") String albumId, Model model) {
    model.addAttribute("album", facebook.mediaOperations().getAlbum(albumId));
    model.addAttribute("photos", facebook.mediaOperations().getPhotos(albumId));
    return "facebook/album";
}

From source file:ru.trett.cis.controllers.BaseController.java

@ExceptionHandler(value = DataIntegrityViolationException.class)
public String conflictHandler(Model model) {
    model.addAttribute("level", "warning");
    model.addAttribute("message", "This data in use.");
    return ERROR_TEMPLATE;
}

From source file:com.lcw.one.modules.sys.web.OfficeController.java

@RequiresPermissions("sys:office:view")
@RequestMapping("form")
public String form(String id, Model model) {
    model.addAttribute("id", id);
    return "modules/sys/officeForm";
}

From source file:com.t2decode.sample.HomeController.java

/**
 * Simply selects the home view to render by returning its name.
 *//*  www. j  a v a  2  s .c  om*/
@RenderMapping
public String home(Locale locale, Model model) {
    model.addAttribute("contactList", contactService.listContact());
    return "list";
}

From source file:cs544.blog.controller.UserController.java

@RequestMapping(value = "/users", method = RequestMethod.GET)
public String getAll(Model model) {
    model.addAttribute("users", userService.getAllUser());
    System.err.println(userService.getAllUser());
    return "userList";
}