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.dub.skoolie.web.controller.system.schedule.SystemGradingPeriodController.java

@RequestMapping(value = "/system/schedule/gradingperiod", method = RequestMethod.GET)
public ModelAndView getGradingPeriods(Model model) {
    model.addAttribute("gradingPeriodBeans", uiGradingPeriodServiceImpl.getGradingPeriods());
    model.addAttribute("gradingPeriodBean", new GradingPeriodBean());
    model.addAttribute("schoolYears", uiGradingPeriodServiceImpl.getSchoolYears());
    return new ModelAndView("system/schedule/gradingperiod");
}

From source file:com.dub.skoolie.web.controller.system.schedule.SystemSchoolYearController.java

@RequestMapping(value = "/system/schedule/schoolyear", method = RequestMethod.GET)
public ModelAndView getSchoolYears(Model model) {
    model.addAttribute("schoolYearBeans", uiSchoolYearServiceImpl.getSchoolYears());
    model.addAttribute("schoolYearBean", new SchoolYearBean());
    model.addAttribute("allSchools", uiSchoolYearServiceImpl.getAllSchools());
    return new ModelAndView("system/schedule/schoolyear");
}

From source file:com.epam.ipodromproject.controller.RegistrationController.java

@RequestMapping(method = RequestMethod.GET)
public String goToRegistrationPage(Model model) {
    model.addAttribute("registrationForm", new RegistrationForm());
    return "registration";
}

From source file:org.openmrs.module.metadatasharing.web.controller.TaskController.java

@RequestMapping(value = LIST_PATH)
public void list(Model model) {
    model.addAttribute(TASKS, taskEngine.getTasks());
}

From source file:pw.spn.mptg.controller.ProjectTemplateController.java

@GetMapping
public String index(Model model) {
    model.addAttribute("pomTemplate", new PomTemplate());
    model.addAttribute("packagingTypes", Packaging.values());
    model.addAttribute("javaVersions", JavaVersion.values());
    model.addAttribute("licenses", License.values());
    model.addAttribute("repositories", Repository.values());
    model.addAttribute("parents", ParentProject.values());
    model.addAttribute("scms", ScmType.values());
    model.addAttribute("dependencies", Dependency.values());
    return "index";
}

From source file:br.com.compositeam.controller.MemberController.java

@RequestMapping(method = RequestMethod.GET)
public String displaySortedMembers(Model model) {
    model.addAttribute("newMember", new Member());
    model.addAttribute("members", memberDao.findAllOrderedByName());
    return "index";
}

From source file:com.bangla.store.controller.UserController.java

@RequestMapping(value = "/add", method = RequestMethod.GET)
public String AddUser(@ModelAttribute Users users, Model model) {
    model.addAttribute("userAuthorities", userService.getAuthorities());
    //        List<Authorities> uLis = userService.getAuthorities();
    //        for (Authorities uA :uLis ) {
    //            System.out.println(" ===Masud=== " + uA.getAuthority());
    //        }/*from w  w w .  j  a v a  2s .c  o m*/
    //                    System.out.println(" ===Masud=== >> ");

    return "users/add";
}

From source file:com.dub.skoolie.web.controller.system.schedule.SystemClassTimeBlockController.java

@RequestMapping(value = "/system/schedule/classtimeblock", method = RequestMethod.GET)
public ModelAndView getClassTimeBlocks(Model model) {
    model.addAttribute("classTimeBlockBeans", uiClassTimeBlockServiceImpl.getClassTimeBlocks());
    model.addAttribute("classTimeBlockBean", new ClassTimeBlockBean());
    model.addAttribute("gradingPeriods", uiClassTimeBlockServiceImpl.getGradingPeriods());
    return new ModelAndView("system/schedule/classtimeblock");
}

From source file:com.dub.skoolie.web.controller.system.school.SystemSchoolController.java

@RequestMapping(value = "/system/schools", method = RequestMethod.GET)
public ModelAndView getSchools(Model model) {
    model.addAttribute("schools", uiSchoolServiceImpl.getSchools());
    model.addAttribute("schoolBean", new SchoolBean());
    return new ModelAndView("system/school/schools");
}

From source file:com.weib.spittr.web.SpittleController.java

@RequestMapping(value = "/spittle/{spittleId}", method = GET)
public String spittle_show(@PathVariable long spittleId, Model model) {
    model.addAttribute("spittle", this.spittleRepository.findOne(spittleId));
    model.addAttribute(spittleId);/*from w  ww. j a va 2s . c o m*/
    return "spittle_show";
}