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:org.jboss.as.quickstarts.spring.controller.WelcomeController.java

/**
 * <p>Handles GET request to the welcome page.</p>
 *
 * @param model the page model//ww w  . j a va 2 s .c  om
 *
 * @return the view name
 */
@RequestMapping(method = RequestMethod.GET)
public String welcome(Model model) {

    model.addAttribute("message", "Warp welcomes!");

    return "welcome";
}

From source file:org.kew.rmf.matchconf.web.MatcherController.java

void populateEditForm(Model uiModel, Matcher matcher) {
    uiModel.addAttribute("matcher", matcher);
    uiModel.addAttribute("matchers", Matcher.findAllMatchers());
    uiModel.addAttribute("wires", Wire.findAllWires());
}

From source file:org.ng200.openolympus.controller.admin.AdminController.java

@RequestMapping(value = "/admin", method = RequestMethod.GET)
public String showControlPanelPage(final Model model) {
    model.addAttribute("lockdownEnabled",
            this.propertyService.get("isOnLockdown", false).<Boolean>as().orElse(false));
    return "admin/admin";
}

From source file:org.osiam.security.controller.LoginController.java

@RequestMapping
public String login(Model model) {
    model.addAttribute("isLdapConfigured", isLdapConfigured);
    return "login";
}

From source file:org.zaizi.sensefy.ui.WhitelabelErrorController.java

@RequestMapping(value = PATH)
public String error(Model model) {
    model.addAttribute("timestamp", "12345678");
    model.addAttribute("error", "error type");
    model.addAttribute("status", "status of the error");
    model.addAttribute("message", "description of the error");
    return "error";
}

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

/**
 * Get all facebook friends/* w ww . ja  va  2  s  .c om*/
 * @param model
 * @return
 */
@RequestMapping(value = "/facebook/friends", method = RequestMethod.GET)
public String showFeed(Model model) {
    model.addAttribute("friends", facebook.friendOperations().getFriendProfiles());
    return "facebook/friends";
}

From source file:com.heimuheimu.runningtask.web.controller.TaskManageController.java

@RequestMapping("/list.htm")
public String list(Model model) {
    model.addAttribute("taskList", taskService.getTaskListByGroup(-1));
    return "task_list";
}

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

/**
 * iconselect.tag/*from ww w  .  j  a  va2  s . co m*/
 */
@RequiresUser
@RequestMapping("iconselect")
public String iconselect(HttpServletRequest request, Model model) {
    model.addAttribute("value", request.getParameter("value"));
    return "modules/sys/tagIconselect";
}

From source file:com.local.ask.controller.spring.HomeController.java

@RequestMapping(value = "/home", method = RequestMethod.GET)
public String loadHomeForm(Model m) {
    m.addAttribute("questions", dbHelper.getRecentQuestions());
    m.addAttribute("tab", 0);
    m.addAttribute("tags", dbHelper.getRecentTags());
    m.addAttribute("qtag", false);
    return "home";
}

From source file:de.dominikschadow.javasecurity.sessionhandling.controller.GreetingController.java

@GetMapping("user/user")
public String greetUser(Model model) {
    model.addAttribute("greeting", greetingService.greetUser());

    return "user/user";
}