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:com.kdubb.socialshowcaseboot.facebook.FacebookFeedController.java

@RequestMapping(value = "/facebook/feed", method = RequestMethod.GET)
public String showFeed(Model model) {
    model.addAttribute("feed", facebook.feedOperations().getFeed());
    return "facebook/feed";
}

From source file:com.kdubb.socialshowcaseboot.twitter.TwitterFriendsController.java

@RequestMapping(value = "/twitter/friends", method = RequestMethod.GET)
public String friends(Model model) {
    model.addAttribute("profiles", twitter.friendOperations().getFriends());
    return "twitter/friends";
}

From source file:com.kdubb.socialshowcaseboot.twitter.TwitterFriendsController.java

@RequestMapping(value = "/twitter/followers", method = RequestMethod.GET)
public String followers(Model model) {
    model.addAttribute("profiles", twitter.friendOperations().getFollowers());
    return "twitter/friends";
}

From source file:com.chuangtc.springmvc.controller.HelloController.java

@RequestMapping("/webapi/hello")
public String hello(@RequestParam(value = "name", required = false, defaultValue = "World") String name,
        Model model) {
    model.addAttribute("name", "1. Hello, " + name);
    return "plaintext";
}

From source file:com.chuangtc.springmvc.controller.HelloController.java

@RequestMapping("/webapi/hello2")
public String hello2(@RequestParam(value = "name", required = false, defaultValue = "World2") String name,
        Model model) {
    model.addAttribute("name", "2. Hello, " + name);
    return "plaintext";
}

From source file:com.iredstring.springmvc.controller.HelloController.java

@RequestMapping("/api/hello")
public String hello(@RequestParam(value = "name", required = false, defaultValue = "World") String name,
        Model model) {
    model.addAttribute("strvalue", "1. Hello, " + name);
    return "plaintext";
}

From source file:com.iredstring.springmvc.controller.HelloController.java

@RequestMapping("/api/hello2")
public String hello2(@RequestParam(value = "name", required = false, defaultValue = "World2") String name,
        Model model) {
    model.addAttribute("strvalue", "2. Hello, " + name);
    return "plaintext";
}

From source file:com.realdolmen.rdfleet.webmvc.controllers.fleet.CompanyCarManagementController.java

@RequestMapping(method = RequestMethod.GET)
public String viewCompanyCars(Model model) {
    model.addAttribute("employeeCarList", employeeCarService.findAllEmployeeCars());
    return "fleet/companycar.list";
}

From source file:com.ryno.retailwarehouseweb3.presentation.WebController.java

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

    model.addAttribute("description1", "this is appliance description");
    return "Appls";
}

From source file:com.stormpath.tutorial.controller.HelloController.java

@RequestMapping("/")
String home(HttpServletRequest req, Model model) {
    model.addAttribute("status", req.getParameter("status"));
    return "home";
}