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:de.berlios.jhelpdesk.web.manager.ticketcategory.TicketCategoryEditController.java

@RequestMapping(value = "/manage/category/new.html", method = RequestMethod.GET)
public String prepareFormForNew(ModelMap map) {
    map.addAttribute("category", new TicketCategory());
    return MANAGE_TICKET_CATEGORY_EDIT; // todo: moe tutaj jaki widok inny? -> new?
}

From source file:de.berlios.jhelpdesk.web.manager.ticketcategory.TicketCategoryEditController.java

@RequestMapping(value = "/manage/category/{parent}/new.html", method = RequestMethod.GET)
public String prepareFormForNew(@PathVariable("parent") Long parent, ModelMap map) {
    map.addAttribute("category", new TicketCategory());
    return MANAGE_TICKET_CATEGORY_EDIT; // todo: moe tutaj jaki widok inny? -> new?
}

From source file:br.edu.ifrs.restinga.modulorh.controle.ServidorController.java

@RequestMapping("/servidor/listarServidor")
public String listarServidor(ModelMap model) {
    model.addAttribute("ListaDeServidores", servidorDAO.listarServidor());
    //retorna pra pagina listaServidor
    return "home/list-servidor";
}

From source file:com.lyncode.performance.controller.IndexController.java

@RequestMapping("/")
public String indexAction(ModelMap model) {
    //        System.out.println("Started");
    model.addAttribute("name", "Performance");
    return "index";
}

From source file:csns.web.controller.CourseController.java

@RequestMapping("/course/search")
public String search(@RequestParam(required = false) String term, ModelMap models) {
    if (StringUtils.hasText(term))
        models.addAttribute("courses", courseDao.searchCourses(term, -1));

    return "course/search";
}

From source file:org.openmrs.module.formentry.web.controller.UploadXsltFormController.java

/**
 * Processes requests to display the form
 * //from w  w  w  .  j av a2 s  .c  om
 * @param formId the id of the form
 * @param model model The {@link ModelMap} object
 */
@RequestMapping(value = UPLOAD_XSLT_FORM, method = RequestMethod.GET)
public void showForm(@RequestParam("formId") Integer formId, ModelMap model) {
    model.addAttribute("formId", formId);
}

From source file:com.leapfrog.lfaeventmanager.admin.controller.DashController.java

@RequestMapping(value = "dashboard", method = RequestMethod.GET)
public String dashboard(ModelMap map) {
    List<Event> eventList = eventService.getAll();
    map.addAttribute("eventList", eventList.size());
    List<EventList> eventLists = eventListService.getAll();
    map.addAttribute("eventLists", eventLists.size());
    return "dash/dashboard";
}

From source file:de.berlios.jhelpdesk.web.ticket.UploadFileController.java

@RequestMapping(method = RequestMethod.GET)
protected String prepareForm(ModelMap map) {
    map.addAttribute("fileBean", new FileUploadBean());
    return TICKETS_UPLOAD_VIEW;
}

From source file:com.havoc.hotel.admin.controller.CommentAdminController.java

@RequestMapping(method = RequestMethod.GET)
public String index(ModelMap map) throws SQLException {
    map.addAttribute("Comments", commentsDAO.getALL());
    return "admin/comments/index";
}

From source file:net.groupbuy.controller.admin.AdPositionController.java

/**
 * /*from  w w w  .  j  a  v  a2s .c  om*/
 */
@RequestMapping(value = "/edit", method = RequestMethod.GET)
public String edit(Long id, ModelMap model) {
    model.addAttribute("adPosition", adPositionService.find(id));
    return "/admin/ad_position/edit";
}