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:gov.nih.nci.cabig.ccts.web.IndexController.java

@Override
protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse res) throws Exception {
    ModelAndView mvc = new ModelAndView("/WEB-INF/views/index.jsp");
    return mvc;/*  ww  w  .j av a  2 s . c om*/
}

From source file:org.iish.visualmets.util.ControllerUtils.java

/**
 * Determines the type of template: JSON or XML.
 * When the client uses a callback function with a tagname, it is assumed the response is JSON.
 * If NULL the XML template is selected.
 *
 * @param viewName Prefix of the template
 * @param callback JSONP tagname/* ww w  .  j a va 2  s .  c o m*/
 * @param response
 * @return the FreeMarker template
 */
public static ModelAndView createModelAndViewPage(String viewName, String callback,
        HttpServletResponse response) {

    String template = (callback == null) ? viewName.concat(".xml") : viewName.concat(".json");

    ModelAndView mav = new ModelAndView(template);

    if (callback == null) {
        response.setContentType("text/xml; charset=utf-8");
    } else {
        response.setContentType("application/json; charset=utf-8");
        mav.addObject("callback", callback.trim());
    }

    return mav;
}

From source file:web.Controller.ContentController.java

public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {

    return new ModelAndView("content");
}

From source file:com.mascova.caliga.controller.DashboardController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView root() {
    return new ModelAndView("dashboard/dashboard-index");
}

From source file:com.amkaawaken.controllers.SponsorController.java

@RequestMapping(value = "/sponsors.htm", method = RequestMethod.GET)
public ModelAndView sponsor() {
    return new ModelAndView("com.amkaawaken.sponsors");
}

From source file:org.fon.documentmanagementsystem.controllers.LoginController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView login() {
    return new ModelAndView("login");
}

From source file:com.amkaawaken.controllers.GetInvolvedController.java

@RequestMapping(value = "/involved.htm", method = RequestMethod.GET)
public ModelAndView involved() {
    return new ModelAndView("com.amkaawaken.involved");
}

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

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

From source file:uta.ak.usttmp.dmcore.controller.HelloWorldController.java

@RequestMapping("/hello")
public ModelAndView helloWorld() {

    String message = "Hello World, This is dm core application. " + "Please control me by rest interface. :)";

    ModelAndView mav = new ModelAndView("hello");
    mav.addObject("message", message);
    mav.addObject("", message);
    return mav;// w w  w  . j  a  v a2  s .  c om
}

From source file:br.sp.mandala.controller.IndexController.java

@RequestMapping(value = "/index")
public ModelAndView index() {
    return new ModelAndView("index");
}