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.ai.bss.webui.datainit.DataController.java

@RequestMapping(value = "/collections", method = RequestMethod.GET)
public String collections(Model model) {
    model.addAttribute("collections", dbInit.obtainCollectionNames());
    return "data/collections";
}

From source file:com.erudika.scoold.controllers.LanguagesController.java

@GetMapping
public String get(HttpServletRequest req, Model model) {
    model.addAttribute("path", "languages.vm");
    model.addAttribute("title", utils.getLang(req).get("translate.select"));
    model.addAttribute("allLocales", new TreeMap<String, Locale>(utils.getLangutils().getAllLocales()));
    model.addAttribute("langProgressMap", utils.getLangutils().getTranslationProgressMap());
    return "base";
}

From source file:com.ujjwal.springhibernate.controller.DefaultController.java

@RequestMapping(method = RequestMethod.GET)
public String index(Model model) {

    category.setName("Books");
    model.addAttribute("category", category);
    return "default";
}

From source file:controllers.admin.SignupController.java

@GetMapping("/signup")
public String showSignupForm(Model model) {
    model.addAttribute("user", new User());
    return "admin/signup";
}

From source file:org.openmrs.module.hospitalcore.web.controller.concept.DiagnosisImporterController.java

@RequestMapping(method = RequestMethod.GET)
public String getUploadForm(Model model) {
    model.addAttribute("uploadFile", new UploadFile());
    return "/module/hospitalcore/concept/uploadForm";
}

From source file:org.smigo.HomeController.java

@RequestMapping(value = { "/gardener/{userName}" }, method = RequestMethod.GET)
public String getWall(@PathVariable String userName, Model model) {
    model.addAttribute("msgTitle", "msg.title.wall");
    model.addAttribute("titleArg", userName);
    return "ng.jsp";
}

From source file:com.springmvc.videoteca.springtiles.controller.SalaController.java

@RequestMapping(value = "/administrarSala.htm", method = RequestMethod.GET)
public String showAddSalaForm(Model modelo) {
    modelo.addAttribute("salaUnit", new Sala());
    modelo.addAttribute("salaList", salaService.findAll());
    return "Administrador/salaAdmin";
}

From source file:com.springmvc.videoteca.springtiles.controller.SalaController.java

@RequestMapping(value = "/administrarSala.htm", method = RequestMethod.POST)
public String loadSalaForm(Model modelo) {
    modelo.addAttribute("salaUnit", new Sala());
    modelo.addAttribute("salaList", salaService.findAll());
    return "Administrador/salaAdmin";
}

From source file:controller.StudentsController.java

@RequestMapping(value = "students", method = RequestMethod.GET)
public String listStudents(Model model) {
    model.addAttribute("student", new Students());
    model.addAttribute("ListStudents", this.studentsService.listStudents());
    return "students";
}

From source file:controller.StudentsController.java

@RequestMapping("studentdata/{id}")
public String studentData(@PathVariable("id") int id, Model model) {
    model.addAttribute("student", this.studentsService.getStudentById(id));

    return "student";
}