Example usage for org.springframework.ui ModelMap addAttribute

List of usage examples for org.springframework.ui ModelMap addAttribute

Introduction

In this page you can find the example usage for org.springframework.ui ModelMap addAttribute.

Prototype

public ModelMap addAttribute(String attributeName, @Nullable Object attributeValue) 

Source Link

Document

Add the supplied attribute under the supplied name.

Usage

From source file:cn.hbu.cs.esearch.controller.EsearchController.java

@RequestMapping(value = "admin", method = { RequestMethod.GET, RequestMethod.HEAD })
public String adminPage(ModelMap modelMap) {
    modelMap.addAttribute("isSearchRequest", false);
    return "admin";
}

From source file:com.trenako.web.controllers.admin.AdminOptionsController.java

@RequestMapping(method = RequestMethod.GET)
public String list(ModelMap model) {
    model.addAttribute("couplerOptions", service.findByFamily(OptionFamily.COUPLER));
    model.addAttribute("headlightsOptions", service.findByFamily(OptionFamily.HEADLIGHTS));
    model.addAttribute("transmissionOptions", service.findByFamily(OptionFamily.TRANSMISSION));
    model.addAttribute("dccOptions", service.findByFamily(OptionFamily.DCC_INTERFACE));

    return "option/list";
}

From source file:org.openmrs.module.systemmetrics.web.controller.SystemPerformanceandUtilizationManageController.java

@RequestMapping(value = "/module/systemmetrics/createdEncounters", method = RequestMethod.GET)
public void countEncounters(ModelMap model) {
    model.addAttribute("user", Context.getAuthenticatedUser());
    PerformanceMonitoringService service = PerformanceMonitoringUtils.getService();
    List<FormsPerHourEntry> valueList = service
            .getFormsPerHourEntryForChart(System.currentTimeMillis() - 43200000, System.currentTimeMillis());
    String dataToGraph = PerformanceMonitoringUtils.prepareEncountersDataToGraph(valueList);
    model.addAttribute("formCounts", dataToGraph);

}

From source file:se.kalendercentralen.calendaradmin.web.controller.HomeController.java

@RequestMapping(value = "/loginfailed", method = RequestMethod.GET)
public String loginerror(ModelMap model) {
    logger.info("loginerror");
    model.addAttribute("error", "true");
    return "mobile/login";

}

From source file:com.amediamanager.controller.MainController.java

@RequestMapping(value = "/not-found", method = RequestMethod.GET)
public String notFound(ModelMap model) {
    model.addAttribute("error", "Resource not found");
    return "base";
}

From source file:com.citrix.cpbm.portal.fragment.controllers.ReportController.java

private void setCustomPage(ModelMap map, String level2Constant) {
    //setPage(map, Page.REPORTS_HOME);
    map.addAttribute(level2Constant, "on");
}

From source file:com.mir00r.controller.HelloController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String HelloMessage(ModelMap map) {
    map.addAttribute("hello", "Hello Spring MVC Framework");
    return "index";
}

From source file:com.mir00r.controller.HelloController.java

@ModelAttribute
public String ShowCommonMsg(ModelMap map) {
    map.addAttribute("msg", "Message Set PErfectly");
    return "einfo";
}

From source file:info.gehrels.voting.web.CastVoteController.java

private ModelAndView createModelAndView(BallotBuilder ballotBuilder, BallotInputTry firstOrSecondTry) {
    ModelMap modelMap = new ModelMap();
    modelMap.addAttribute("ballotLayout", ballotLayoutState.ballotLayout);
    modelMap.addAttribute("ballotBuilder", ballotBuilder);
    modelMap.addAttribute("firstOrSecondTry", firstOrSecondTry);
    return new ModelAndView("castVote", modelMap);
}

From source file:com.trenako.web.controllers.admin.AdminUsersController.java

@RequestMapping(method = RequestMethod.GET)
public String usersList(Pageable pageable, ModelMap model) {
    model.addAttribute("users", userService.findAll(pageable));
    return "user/list";
}