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.stockwatcher.web.UserController.java

@RequestMapping(method = RequestMethod.GET)
public String allUsers(Model model) {
    model.addAttribute("users", dao.getUsers());
    return "users";
}

From source file:org.zols.web.CoreController.java

@RequestMapping("/create_page/{linkName}")
public String createPage(@PathVariable(value = "linkName") String linkName, Model model) {
    model.addAttribute("linkName", linkName);
    return "create_page";
}

From source file:spring.showcase.form.FrontController.java

@RequestMapping("/")
public String Index(Model model) {
    model.addAttribute("user", new User());
    return "index";
}

From source file:$.MemberController.java

@RequestMapping(method = RequestMethod.GET)
    public String displaySortedMembers(Model model) {
        model.addAttribute("newMember", new Member());
        model.addAttribute("members", memberDao.findAllOrderedByName());
        return "index";
    }//  w w w  . ja  v  a  2  s .  co  m

From source file:com.ace.erp.controller.IndexController.java

@RequestMapping(value = { "/{index:index;?.*}" })
public String index(@CurrentUser User user, Model model) {
    List<Menu> menuList = resourceService.findMenus(user);
    model.addAttribute("menuList", menuList);

    return "/index";
}

From source file:de.asgarbayli.rashad.hbd.controllers.ParametersController.java

@ModelAttribute
public void addAttributes(Model model) {
    model.addAttribute("title", "Parameters");
    Messages.resetMessage(model);//w  w  w  .ja  v  a  2s .  c  o m
}

From source file:de.christian_klisch.software.servercontrol.web.WebAction.java

@RequestMapping(value = "/list", method = RequestMethod.GET)
public ModelAndView list(Model model) {
    model.addAttribute("template", application.getFilledTemplate());
    return new ModelAndView("list");
}

From source file:org.opencron.server.controller.ConfigController.java

@RequestMapping("/view")
public String settings(Model model) {
    model.addAttribute("config", configService.getSysConfig());
    return "config/view";
}

From source file:org.opencron.server.controller.ConfigController.java

@RequestMapping("/editpage")
public String editPage(Model model) {
    model.addAttribute("config", configService.getSysConfig());
    return "config/edit";
}

From source file:com.archive.spring.ImageController.java

@RequestMapping(value = "/SpringMVCHibernate/detal/{id}", method = RequestMethod.GET)
public String getImageById(@PathVariable int id, Model m) {
    m.addAttribute("image", imageService.getImageById(id));
    return null;//from  w  w  w  .j  a  v  a  2  s. c  om
}