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

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

Introduction

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

Prototype

public ModelAndView(View view) 

Source Link

Document

Convenient constructor when there is no model data to expose.

Usage

From source file:org.fits.proweb.controller.exception.ExceptionController.java

@ExceptionHandler(CannotGetJdbcConnectionException.class)
public ModelAndView CannotGetConnectionException(Exception ex) {
    ModelAndView model = new ModelAndView("errors/db_error");
    model.addObject("ex", ex);
    return model;
}

From source file:com.opencnc.controllers.InicioController.java

@RequestMapping("/inicio/infcam")
public ModelAndView infcam() {
    ModelAndView m = new ModelAndView("/inicio/infcam");
    return m;
}

From source file:com.leapfrog.inventorymanagementsystem.controller.DefaultController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView index() {
    ModelAndView mv = new ModelAndView("index");
    mv.addObject("title", "Welcome to Inventory Management System");
    return mv;//from   w w w .  j a  va 2  s . c  om
}

From source file:com.leapfrog.inventorymanagementsystem.controller.LoginController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView index() {
    ModelAndView mv = new ModelAndView("login");
    mv.addObject("title", "Please Login");
    return mv;/* w ww  . j  a v  a 2 s.co  m*/
}

From source file:controladores.empController.java

@Override
public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
    ModelAndView mv = new ModelAndView("empleados");
    String out = "Datos de los empleados:";
    Session session = HibernateUtil.getSessionFactory().getCurrentSession();
    session.beginTransaction();//w  ww.  ja v a  2 s . c  o  m
    List Result = session.createQuery("from Emp as emp").list();
    mv.addObject("empleados", Result);
    session.getTransaction().commit();
    mv.addObject("message", out);
    return mv;
}

From source file:org.tsm.concharto.web.signup.LoginSignupHelper.java

/**
 * Go where we were originally heading.  The redirect view must already be in the 
 * session at AuthConstants.SESSION_AUTH_TARGET_URI
 * /* ww w. ja v a2 s.c o  m*/
 * @param request
 * @return where we were originally heading
 */
public static ModelAndView continueToRequestedUrl(HttpServletRequest request) {
    String view = (String) WebUtils.getSessionAttribute(request, AuthConstants.SESSION_AUTH_TARGET_URI);
    //now erase the target so we don't use it another time
    WebUtils.setSessionAttribute(request, AuthConstants.SESSION_AUTH_TARGET_URI, null);
    if (view != null) {
        return new ModelAndView(new RedirectView(view));
    } else {
        return new ModelAndView("redirect:/");
    }
}

From source file:com.dub.skoolie.web.controller.system.schedule.events.SystemEventsController.java

@RequestMapping(value = "/system/schedule/events", method = RequestMethod.GET)
public ModelAndView getIndex(Model model) {
    return new ModelAndView("system/schedule/events/index");
}

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

@RequestMapping("/welcome")
public ModelAndView welcomePage() {
    ModelAndView model = new ModelAndView("welcome");
    model.addObject("obj", new Oggetto());
    return model;
}

From source file:Controller.MeetingController.java

@RequestMapping("/welcome")
protected ModelAndView handleRequestInternal(HttpServletRequest hsr, HttpServletResponse hsr1)
        throws Exception {
    ModelAndView modelandview = new ModelAndView("index");
    modelandview.addObject("welcomeMessage", "Hi user, welcome to the first MVC app");

    return modelandview;
}

From source file:com.bits.protocolanalyzer.mvc.controller.HomeController.java

@RequestMapping
public ModelAndView home() {
    ClassLoader cl = ClassLoader.getSystemClassLoader();
    URL[] urls = ((URLClassLoader) cl).getURLs();
    ModelAndView mav = new ModelAndView("home");
    mav.addObject("paths", urls);
    return mav;/*w w w  . j  av  a2 s.  c  o m*/
}