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:com.mycompany.controller.EmployeeController.java

@RequestMapping("admin_employee_form")
public ModelAndView getForm(@ModelAttribute Employee employee) {
    return new ModelAndView("admin_employee_form");
}

From source file:net.indialend.attendance.controller.IndexController.java

@RequestMapping(value = "/index", method = RequestMethod.GET)
public ModelAndView login(@RequestParam(value = "error", required = false) String error,
        @RequestParam(value = "logout", required = false) String logout, Principal principal) {

    ModelAndView model = new ModelAndView("index");

    if (error != null) {
        model.addObject("error", "Invalid username and password!");
    }//www .  j a va 2s .  co  m

    if (logout != null) {
        model.addObject("msg", "You've been logged out successfully.");
    }

    if (principal != null) {
        model.setView(new RedirectView("branch/list"));
    }
    return model;

}

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

@RequestMapping("/web_info/github_info")
public ModelAndView github() {
    ModelAndView m = new ModelAndView("/web_info/github_info");
    return m;/*w w w.  j  a v a 2  s.c o  m*/
}

From source file:br.edu.ifpb.controllers.SimpleGetPagesController.java

@GetMapping("/")
public ModelAndView index() {

    if (httpSession.getAttribute("user") == null) {

        return new ModelAndView("index");

    } else {//from   w  ww . j  ava2 s  . co  m

        return new ModelAndView("redirect:/home");
    }

}

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

@RequestMapping(method = RequestMethod.GET)
public ModelAndView home(Authentication authentication) {
    //return new ModelAndView("admin_home");
    UserDto userDto = (UserDto) authentication.getPrincipal();
    switch (userDto.getRola().getNazivRole()) {
    case "ADMIN":
        return new ModelAndView("admin_home");
    case "USER":
        return new ModelAndView("user_home");
    case "SUPERADMIN":
        return new ModelAndView("superadmin_home");
    default:/*  w w  w . ja v a  2 s .c om*/
        return new ModelAndView("login");
    }
}

From source file:cn.cuizuoli.gotour.controller.LoginController.java

@RequestMapping("")
public ModelAndView login() {
    return new ModelAndView("login");
}

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

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

From source file:com.havoc.hotel.controller.RegisterController.java

@RequestMapping(value = "/add", method = RequestMethod.GET)
public ModelAndView add() throws SQLException {
    ModelAndView mv = new ModelAndView("register/add");
    mv.addObject("Customer", new Customer());
    return mv;//w  w w.  j ava 2s.  c  o m
}

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

@RequestMapping(value = "/deletedpage")
public ModelAndView deletePoi() {
    ModelAndView model = new ModelAndView("deletedpage");
    return model;
}

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

@RequestMapping(value = "/deletepoi")
public ModelAndView deletePoi() {
    ModelAndView model = new ModelAndView("deleteform");
    return model;
}