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.library.bookarticlelibrary.controller.JournalsController.java

@RequestMapping(value = "/journals", method = RequestMethod.GET)
public ModelAndView displayJournals() {
    ModelAndView model = new ModelAndView("journals");
    List<Journal> journalList = journalDao.list();
    model.addObject("title", "journals");
    model.addObject("journalList", journalList);

    return model;
}

From source file:bc8.movies.controllers.LoginController.java

@RequestMapping(value = "/validateLogin", method = RequestMethod.POST)
public ModelAndView validateLogin(User user, HttpSession session) {
    ModelAndView mv = new ModelAndView("home");

    User currUser = userService.getUser(user);
    if (currUser != null) {
        session.setAttribute("user", currUser);
        mv.setViewName("redirect:/listFavorites");
    }/*from   w ww  .  j  a v  a  2s.  com*/

    return mv;
}

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

@RequestMapping(value = "/backupimg")
public ModelAndView backup(HttpServletRequest request) throws IOException {
    ModelAndView model = new ModelAndView("showResult");
    HttpSession session = request.getSession();

    ServletContext sc = session.getServletContext();
    File root = new File(sc.getRealPath("/"));

    File dir = new File(sc.getRealPath("/") + "dist" + File.separator + "poi");
    File dir2 = new File(sc.getRealPath("/") + "dist" + File.separator + "user");
    File dir3 = new File(sc.getRealPath("/") + "dist" + File.separator + "page");
    File dir4 = new File(sc.getRealPath("/") + "dist" + File.separator + "dpage");
    copy(dir.getCanonicalPath(),/*from www .  j a  v  a  2s.  com*/
            root.getParentFile().getParentFile().getParentFile().getPath() + File.separator + "BackupImg");
    copy(dir2.getCanonicalPath(),
            root.getParentFile().getParentFile().getParentFile().getPath() + File.separator + "BackupImg");
    copy(dir3.getCanonicalPath(),
            root.getParentFile().getParentFile().getParentFile().getPath() + File.separator + "BackupImg");
    copy(dir4.getCanonicalPath(),
            root.getParentFile().getParentFile().getParentFile().getPath() + File.separator + "BackupImg");
    model.addObject("mess", "Tutte le immagini sono state copiate");
    return model;
}

From source file:com.museum_web.controller.AnswerController.java

@RequestMapping("/answer")
public ModelAndView list() {

    lista = new AnswerService().listAnswers();
    ModelAndView mv = new ModelAndView("answer/list");
    mv.addObject("lista", lista);
    return mv;//from  w w w  .j a  v a2s. co  m
}

From source file:com.naver.timetable.controller.AdminController.java

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

From source file:com.faces.controller.CaptureController.java

@RequestMapping(value = "/set/rollnumber", method = RequestMethod.POST)
public ModelAndView setRollnumber(HttpServletRequest request) {
    String roll = request.getParameter("tbRollNumber");
    System.out.println("....................rollNumber = " + roll);
    mav = new ModelAndView("upload");
    return mav;/* w  w w. j a  v  a 2 s.  c o  m*/
}

From source file:com.orca.web.DocumentationController.java

@RequestMapping(value = "documentation.html")
public ModelAndView documentation(@RequestParam("surveyId") Integer surveyId) {
    Survey survey = surveyService.getSurvey(surveyId);
    if (!surveyService.authorizedUser(survey)) {
        return new ModelAndView("notAuthorized");
    }//w  ww . ja  v  a  2  s.  c o m
    ModelAndView mav = new ModelAndView("documentation");
    mav.addObject("documentation", survey.getDocumentation());
    mav.addObject("survey", survey);
    return mav;
}

From source file:quanlyhocvu.api.web.controller.teacher.TeacherController.java

@RequestMapping(value = "information")
public @ResponseBody ModelAndView information() {
    return new ModelAndView("teacher/information");
}

From source file:com.banco.controller.UserController.java

@RequestMapping(value = "/registrar", method = RequestMethod.GET)
public ModelAndView registrar(Model model) {
    ModelAndView modelAndView = new ModelAndView("registrar");
    modelAndView.addObject("Usuario", new User());
    return modelAndView;
}