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, String modelName, Object modelObject) 

Source Link

Document

Convenient constructor to take a single model object.

Usage

From source file:com.crunchify.controller.HelloWorld.java

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

    String message = "<br><div style='text-align:center;'>"
            + "<h3>********** Hello World, Spring MVC Tutorial</h3>This message is coming from CrunchifyHelloWorld.java **********</div><br><br>";
    return new ModelAndView("welcome", "message", message);
}

From source file:ThuaDatControllers.FormControllers.java

/**
 * chuyen den trang thua dat/*from w  w  w .  j  a  va 2s .  c o  m*/
 * @param model
 * @return
 */
@RequestMapping(value = "/thuadat", method = RequestMethod.GET)
public ModelAndView printDemoForm(Model model) {
    model.addAttribute("message", "Xin cho cc bn");
    tblThuaDat objThuaDat = new tblThuaDat();
    //        objThuaDat.SHBANDO = 10;
    //        objThuaDat.SHTHUA = 1;
    return new ModelAndView("demoform", "objThuaDat", objThuaDat);
}

From source file:psiprobe.controllers.apps.ListAppInitParamsController.java

@Override
protected ModelAndView handleContext(String contextName, Context context, HttpServletRequest request,
        HttpServletResponse response) throws Exception {

    ModelAndView mv = new ModelAndView(getViewName(), "appInitParams",
            ApplicationUtils.getApplicationInitParams(context, getContainerWrapper()));
    if (SecurityUtils.hasAttributeValueRole(getServletContext(), request)) {
        mv.addObject("allowedToViewValues", Boolean.TRUE);
    }// ww  w  .  ja  va 2 s .c  o  m
    return mv;
}

From source file:controller.makeAppointment.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView makeAppointment() {
    ModelAndView modelAndView = new ModelAndView("makeAppointment", "makeAppointment", new Appointment1());
    modelAndView.addObject("patients", service.getPatients());
    modelAndView.addObject("doctors", service.getDoctors());
    return modelAndView;
}

From source file:edu.infsci2560.controllers.DvdsController.java

@RequestMapping(value = "dvds", method = RequestMethod.GET)
public ModelAndView index() {
    return new ModelAndView("dvds", "dvds", repository.findAll());
}

From source file:com.googlecode.psiprobe.controllers.apps.ListAppInitParamsController.java

protected ModelAndView handleContext(String contextName, Context context, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    ModelAndView mv = new ModelAndView(getViewName(), "appInitParams",
            ApplicationUtils.getApplicationInitParams(context, getContainerWrapper()));
    if (SecurityUtils.hasAttributeValueRole(getServletContext(), request)) {
        mv.addObject("allowedToViewValues", Boolean.TRUE);
    }//from w w  w . j  a v a2 s. c o m

    return mv;
}

From source file:net.testdriven.psiprobe.controllers.apps.ListAppInitParamsController.java

protected ModelAndView handleContext(String contextName, Context context, HttpServletRequest request,
        HttpServletResponse response) throws Exception {
    ModelAndView mv = new ModelAndView(getViewName(), "appInitParams",
            ApplicationUtils.getApplicationInitParams(context));
    if (SecurityUtils.hasAttributeValueRole(getServletContext(), request)) {
        mv.addObject("allowedToViewValues", Boolean.TRUE);
    }/*from  w  w  w .j  a  v a  2 s . c  o  m*/

    return mv;
}

From source file:fm.last.lastfmlive.controllers.UserEntryController.java

@RequestMapping("/")
public ModelAndView userEntry() {
    return new ModelAndView("userEntry", "users", theBrain.getUserList());
}

From source file:com.test.swing1.mavenspringwebapplication.BierController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView getCountries() {
    // WERKT !!!/*from w  ww  .j a va  2  s .  c  om*/
    return new ModelAndView("bier", "bieren", domain.getBieren());

}

From source file:com.test.swing1.mavenspringwebapplication.CategorieController.java

@RequestMapping(method = RequestMethod.GET)
public ModelAndView getCountries() {
    // TODO FIX VOOR DE JUISTE SOORT
    ModelAndView mav = new ModelAndView("categorie", "categorie", domain.getSoorten());

    return mav;/*from   w w w .  jav  a2 s .  com*/

}