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:app.controller.adm.socio.socio.SocioController.java

@RequestMapping(method = RequestMethod.GET)
public String index(Model model) {
    model.addAttribute("socios", service.list());
    return "adm/socio/socio";
}

From source file:app.controller.adm.socio.socio.SocioController.java

@RequestMapping("new")
public String nuevo(Model model) {
    model.addAttribute("socio", new Persona());
    return "adm/socio/socioForm";
}

From source file:com.dub.skoolie.web.controller.system.district.SystemDistrictController.java

@RequestMapping(value = "/system/districts", method = RequestMethod.GET)
public ModelAndView getDistricts(Model model) {
    model.addAttribute("districts", uiDistrictServiceImpl.getDistricts());
    model.addAttribute("districtBean", new DistrictBean());
    return new ModelAndView("system/district/districts");
}

From source file:de.dominikschadow.javasecurity.controller.InterceptMeController.java

@PostMapping("second")
public String secondTask(Model model) {
    model.addAttribute("result", "FAILURE");

    return "result";
}

From source file:se.omegapoint.facepalm.client.controllers.SearchController.java

@RequestMapping(value = "search", method = RequestMethod.GET)
public String search(final @RequestParam(value = "query", required = false) SearchQuery searchQuery,
        final Model model) {
    model.addAttribute("searchResult",
            isNotBlank(searchQuery.value) ? searchAdapter.findUsersLike(searchQuery) : emptyList());
    model.addAttribute("searchQuery", searchQuery.value);

    return "search";
}

From source file:com.iselect.web.controller.AccountController.java

@RequestMapping(value = { "/new" }, method = RequestMethod.GET)

public String newAccount(Model model) {
    model.addAttribute("action", "new");
    return "account.details";
}

From source file:com.mascova.caliga.controller.LoginController.java

@RequestMapping(value = "/forget", method = RequestMethod.GET)
public String forgetPassword(Model model) {
    model.addAttribute("forgetForm", new ForgetForm());
    return "page-lost-password";
}

From source file:com.unused.Point3DController.java

@RequestMapping("helloWorld")
public String helloWorld(Model model) {
    model.addAttribute("message", "Hello World!");
    return "helloWorld mother fucker";
}

From source file:ph.fingra.statisticsweb.controller.AccountController.java

@RequestMapping(method = RequestMethod.GET, value = "/form")
public String editForm(@ActiveUser FingraphUser activeUser, Model model) {

    model.addAttribute("member", memberService.get(activeUser.getMemberid()));

    return "account/form";
}

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

/**
 * Get all feeds//from   w w w.ja va2 s.c o m
 * @param model
 * @return
 */
@RequestMapping(value = "/facebook/feed", method = RequestMethod.GET)
public String showFeed(Model model) {
    model.addAttribute("feed", facebook.feedOperations().getFeed());
    return "facebook/feed";
}