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.onlinebusiness.controller.UserController.java

@RequestMapping(value = "/register", method = RequestMethod.GET)
public String register(Model model) {
    model.addAttribute("customer", new Customer());
    return "register";
}

From source file:org.fenixedu.qubdocs.ui.FenixeduQubdocsReportsController.java

@RequestMapping
public String home(Model model) {
    model.addAttribute("world", "World");
    return "fenixedu-qubdocs-reports/home";
}

From source file:org.zaizi.sensefy.auth.error.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/error";
}

From source file:sample.web.item.ItemController.java

@RequestMapping(value = "/{itemId}", method = RequestMethod.GET)
public String viewDetail(@PathVariable("itemId") String itemId, Model model) {
    model.addAttribute("item", itemService.getItem(itemId));
    return "item/detail";
}

From source file:com.job.portal.HomeController.java

@RequestMapping(value = "/home", method = RequestMethod.POST)
public String login(@Validated User user, Model model) {
    model.addAttribute("userName", user.getUserName());
    return "user";
}

From source file:edu.lfa.df.controller.DashboardController.java

@RequestMapping(value = "/newform", method = RequestMethod.GET)
public String createform(Model model) {
    model.addAttribute("FormFields", formfieldDAO.getAll());
    return "dashboard/newform";
}

From source file:test005.social.SocialController.java

@RequestMapping("/social")
public String home(Principal currentUser, Model model) {
    model.addAttribute("connectionsToProviders", getConnectionRepository().findAllConnections());
    return "social/home/home";
}

From source file:com.github.bysrhq.todoapp.controller.ToDoController.java

@GetMapping
public String showToDoPage(Model model) {
    model.addAttribute("toDos", toDoRepository.findAll());

    return "ToDoPage";
}

From source file:com.gopivotal.cla.web.RootController.java

@Transactional(readOnly = true)
@RequestMapping(method = RequestMethod.GET, value = "")
String index(Model model) {
    model.addAttribute("linkedRepositories", this.linkedRepositoryRepository.findAll(new Sort("name")));

    return "index";
}

From source file:com.kabaso.askweb.presentation.CputController.java

@RequestMapping(value = "cput/students", method = RequestMethod.GET)
public String getStudents(Model model) {

    model.addAttribute("name1", "This is a Student Name");

    return "students";
}