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:uk.org.funcube.fcdw.controller.WodController.java

@RequestMapping(value = "", method = RequestMethod.GET)
public ModelAndView getFuncube() {
    ModelAndView model = new ModelAndView("wod");
    model.addObject("satelliteId", "2");
    return model;
}

From source file:uk.org.funcube.fcdw.controller.WodController.java

@RequestMapping(value = "/{satelliteId}", method = RequestMethod.GET)
public ModelAndView getSatellite(@PathVariable("satelliteId") Long satelliteId) {
    ModelAndView model = new ModelAndView("wod");
    model.addObject("satelliteId", satelliteId.toString());
    return model;
}

From source file:com.intel.cosbench.controller.web.TimelinePageController.java

protected ModelAndView process(WorkloadInfo wInfo, StageInfo sInfo) {
    ModelAndView result = new ModelAndView("timeline");
    result.addObject("wInfo", wInfo);
    result.addObject("sInfo", sInfo);
    return result;
}

From source file:de.iew.raspimotion.controllers.IndexController.java

@RequestMapping(value = "/index.html", method = RequestMethod.GET)
public ModelAndView indexAction() {
    ModelAndView mav = new ModelAndView("index");
    mav.addObject("pageTitle", "Raspi Motion");
    return mav;/*  w  w w .j  a  v a 2  s .c  o m*/
}

From source file:com.orchestra.portale.controller.CheckController.java

@RequestMapping("/check")
public ModelAndView check(HttpServletRequest request) {
    HttpSession session = request.getSession();
    ServletContext sc = session.getServletContext();
    File f = new File(sc.getRealPath("/"));
    ModelAndView model = new ModelAndView("check");
    model.addObject("mess",
            f.getParentFile().getParentFile().getParentFile().getPath() + File.separator + "BackupImg");
    return model;
}

From source file:io.springagora.store.web.controllers.WebExceptionHandlerAdvice.java

@ExceptionHandler(EntityNotFoundException.class)
public ModelAndView entityNotFound(Exception exception, WebRequest request) {
    ModelAndView mav = new ModelAndView("error");
    mav.addObject("categories", Category.findAll());
    mav.addObject("errorMessage", exception.getMessage());
    return mav;//from w w  w.  java2 s . c o  m
}

From source file:uk.org.funcube.fcdw.controller.HiresController.java

@RequestMapping(value = "", method = RequestMethod.GET)
public ModelAndView getFuncube() {
    ModelAndView model = new ModelAndView("hires");
    model.addObject("satelliteId", "2");
    return model;
}

From source file:uk.org.funcube.fcdw.controller.HiresController.java

@RequestMapping(value = "/{satelliteId}", method = RequestMethod.GET)
public ModelAndView getSatellite(@PathVariable("satelliteId") Long satelliteId) {
    ModelAndView model = new ModelAndView("hires");
    model.addObject("satelliteId", satelliteId.toString());
    return model;
}

From source file:com.kdgregory.pathfinder.test.spring3.pkg2.ControllerC.java

@RequestMapping(method = RequestMethod.GET)
protected ModelAndView getC(HttpServletRequest request, HttpServletResponse response) throws Exception {
    ModelAndView mav = new ModelAndView("simple");
    mav.addObject("reqUrl", request.getRequestURI());
    mav.addObject("controller", getClass().getName());
    return mav;//from  w  w  w  .  j  ava 2  s  .com
}

From source file:com.rakesh.rp3599.controller.ExceptionHandlingController.java

@ExceptionHandler({ Exception.class, AgencyNotFoundException.class })
public ModelAndView handleError(HttpServletRequest req, Exception exception) {
    ModelAndView mav = new ModelAndView();
    mav.addObject("exception", exception);
    mav.addObject("url", req.getRequestURL());
    mav.setViewName("error");
    return mav;//from ww  w  .  j  av  a  2 s.c  o m
}