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.qubit.solution.fenixedu.bennu.webservices.ui.management.keystores.UploadKeyStoreController.java

@RequestMapping(value = "/{oid}")
public String uploadkeystore(@PathVariable("oid") DomainKeyStore domainKeyStore, Model model) {

    model.addAttribute("domainKeyStore", domainKeyStore);
    return "webservices/management/keystores/uploadkeystore";
}

From source file:pt.ist.fenix.ui.spring.BookmarksController.java

@RequestMapping
public String bookmarks(Model model) {
    model.addAttribute("bookmarks",
            Authenticate.getUser().getBookmarksSet().stream()
                    .sorted(Comparator.comparing(cat -> cat.getSite().getName().getContent()))
                    .collect(Collectors.toList()));
    final Student student = AccessControl.getPerson().getStudent();
    if (student != null) {
        model.addAttribute("courses",
                student.getActiveRegistrationsIn(ExecutionSemester.readActualExecutionSemester()).stream()
                        .flatMap(registration -> registration
                                .getAttendingExecutionCoursesForCurrentExecutionPeriod().stream())
                        .collect(Collectors.toList()));
    }//ww w. j  av a2s .c o  m
    return "fenix-learning/bookmarks";
}

From source file:com.mum.controller.HomeController.java

@RequestMapping("/")
public String welcome(Model model) {
    model.addAttribute("greeting", "Welcome to Web Store!");
    model.addAttribute("tagline", "The one and only amazing web store");
    Student student = new Student("suniljoshi", "june", 2014);
    student.setBatch("oct");
    model.addAttribute("studentInfo", student);
    return "welcome";
}

From source file:com.rorrell.zootest.controllers.EnvironmentController.java

@RequestMapping("/environment/{id}")
public String getById(@PathVariable Long id, Model model) {
    model.addAttribute("environment", envRepo.findOne(id));
    return "environment";
}

From source file:com.rorrell.zootest.controllers.EnvironmentController.java

@RequestMapping("/environment/edit/{id}")
public String editEnvironment(@PathVariable Long id, Model model) {
    model.addAttribute("environment", envRepo.findOne(id));
    return "environmentform";
}

From source file:com.yunmel.blog.web.site.IndexController.java

@RequestMapping("article/add.html")
public String toArticlePage(Model model) {
    model.addAttribute("res", Site.getResPath());
    return site("article-add");
}

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

@ModelAttribute
protected void addModelProperties(Model model) {
    model.addAttribute("infoMessages", new ArrayList<String>());
    model.addAttribute("warningMessages", new ArrayList<String>());
    model.addAttribute("errorMessages", new ArrayList<String>());

    //Add here more attributes to the Model
    //model.addAttribute(<attr1Key>, <attr1Value>);
    //....//from  w ww . j a  v a2  s . com
}

From source file:com.github.dbourdette.glass.web.controller.LogsController.java

@RequestMapping("/logs")
public String logs(@RequestParam(defaultValue = "0") int index, Model model) {
    model.addAttribute("page", executions.find(Query.oneBasedIndex(index)));

    return "logs";
}

From source file:com.qubit.solution.fenixedu.bennu.webservices.ui.management.keystores.UploadKeyController.java

@RequestMapping(value = "/{oid}")
public String uploadkey(@PathVariable("oid") DomainKeyStore domainKeyStore, Model model) {

    model.addAttribute("domainKeyStore", domainKeyStore);
    return "webservices/management/keystores/uploadkey";
}

From source file:com.stephengream.simplecms.web.controllers.ProfileController.java

@RequestMapping(value = "new", method = RequestMethod.GET)
public String getNewUser(Model model) {
    model.addAttribute("user", new UserCreationForm());
    return NEW_PROFILE;
}