Example usage for org.springframework.web.servlet ModelAndView addObject

List of usage examples for org.springframework.web.servlet ModelAndView addObject

Introduction

In this page you can find the example usage for org.springframework.web.servlet ModelAndView addObject.

Prototype

public ModelAndView addObject(String attributeName, @Nullable Object attributeValue) 

Source Link

Document

Add an attribute to the model.

Usage

From source file:br.com.joaops.smt.controller.SystemModuleController.java

@RequestMapping(value = "/edit/{id}", method = RequestMethod.GET)
public ModelAndView edit(@PathVariable Long id, HttpServletRequest request, HttpServletResponse response) {
    ModelAndView mav = new ModelAndView("/system/module/edit");
    mav.addObject("module", systemModuleService.findOne(id));
    return mav;/*from  w ww .  j av  a 2s.c o  m*/
}

From source file:com.epam.cme.storefront.interceptors.beforeview.AnalyticsPropertiesBeforeViewHandler.java

protected void addHostProperty(final String serverName, final ModelAndView modelAndView, final String configKey,
        final String modelKey) {
    modelAndView.addObject(modelKey, hostConfigService.getProperty(configKey, serverName));
}

From source file:com.infinity.controller.ResController.java

@RequestMapping(value = { "/res" })
public ModelAndView getIndex() throws IOException {

    HashMap<ClientOffers, ArrayList<Candidat>> searchEngine = null;

    searchEngine = searchEngineServices.searchEngine();

    //        for (Map.Entry<ClientOffers, ArrayList<Candidat>> entrySet : searchEngine.entrySet()) {
    //            ClientOffers key = entrySet.getKey();
    //            ArrayList<Candidat> value = entrySet.getValue();
    //            for (Candidat candidat : value) {
    ///*from ww  w.ja v  a  2  s .c  o m*/
    //                if (candidat.getSendTo() != null) {
    //
    //                    ArrayList<SendTo> sendToList = candidat.getSendTo();
    //                    for (SendTo sendTo1 : sendToList) {
    //                        LOG.debug("client id : " +sendTo1.getClientId());
    //                        LOG.debug("candidat id : " +sendTo1.getCandidatId());
    //                    if( key.getPartialsClients().getId() == null ? sendTo1.getClientId() == null : key.getPartialsClients().getId().equals(sendTo1.getClientId()))    
    //                        
    //                         toRemove.add(key);
    //                    
    //                    }
    //                }
    //            }
    //
    //        }

    //        for (ClientOffers toRemove1 : toRemove) {
    //            
    //            
    //        }

    ModelAndView mv = new ModelAndView("searchResults");

    mv.addObject("candidat", searchEngine);
    return mv;
}

From source file:com.infinity.controller.SchoolController.java

@RequestMapping(value = { "/school/add/{id}" }, method = RequestMethod.GET)
public ModelAndView add(@PathVariable String id) throws IOException, InterruptedException, ExecutionException {

    Candidat byId = candidatService.getById(id);
    ModelAndView modelAndView = new ModelAndView("addSchool");
    modelAndView.addObject("candidat", byId);

    return modelAndView;
}

From source file:org.ala.spatial.services.web.ApplicationController.java

@RequestMapping(value = APP_LIST)
public ModelAndView viewApplications() {
    List<Application> apps = applicationDao.findApplications();

    System.out.println("Got " + apps.size() + " items");

    ModelAndView m = new ModelAndView("apps/list");
    m.addObject("apps", apps);

    return m;//from ww  w  .  j av a  2s. c  o  m
}

From source file:org.cloudfoundry.practical.demo.web.controller.TimeoutController.java

@RequestMapping("/timeout/default")
public ModelAndView timeoutDefault() {
    ModelAndView modelAndView = new ModelAndView("timeout");
    modelAndView.addObject("name", "Default");
    modelAndView.addObject("useshim", false);
    modelAndView.addObject("ajaxcall", "ajaxrequest");
    return modelAndView;
}

From source file:org.cloudfoundry.practical.demo.web.controller.TimeoutController.java

@RequestMapping("/timeout/drip")
public ModelAndView timeouDrip() {
    ModelAndView modelAndView = new ModelAndView("timeout");
    modelAndView.addObject("name", "Drip");
    modelAndView.addObject("useshim", false);
    modelAndView.addObject("ajaxcall", "ajaxdrip");
    return modelAndView;
}

From source file:org.cloudfoundry.practical.demo.web.controller.TimeoutController.java

@RequestMapping("/timeout/shim")
public ModelAndView timeoutShim() {
    ModelAndView modelAndView = new ModelAndView("timeout");
    modelAndView.addObject("name", "Shim");
    modelAndView.addObject("useshim", true);
    modelAndView.addObject("ajaxcall", "ajaxrequest");
    return modelAndView;
}

From source file:br.com.joaops.smt.controller.SystemDatabaseController.java

@RequestMapping(value = "/add", method = RequestMethod.GET)
public ModelAndView add(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView mav = new ModelAndView("/system/database/add");
    mav.addObject("database", systemDatabaseService.newSystemDatabase());
    return mav;/*from  w  ww  .j  av  a2  s .c o m*/
}

From source file:br.com.joaops.smt.controller.SystemModuleController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView index(HttpServletRequest request, HttpServletResponse response, Pageable p) {
    ModelAndView mav = new ModelAndView("/system/module/index");
    mav.addObject("page", systemModuleService.searchAllModules(p));
    return mav;//  w ww  .  ja v  a 2  s .com
}