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.naver.timetable.controller.TimeTableController.java

@RequestMapping(value = "/viewTimetable")
public ModelAndView viewTimeTable(@SessionUser User user, String year, String season) {
    List<Lecture> lectureList = timetableBO.getTimeTable(user.getStudentNum(), year, season);
    return new ModelAndView("timetable").addObject("lectureList", lectureList);
}

From source file:com.anthony.forumspring.controller.FileUploadController.java

@RequestMapping(value = "/upload", method = RequestMethod.GET)
public ModelAndView uploadView() {

    return new ModelAndView("upload");
}

From source file:org.zhangmz.pickles.controller.user.UserMainController.java

@RequestMapping(value = "/main", method = RequestMethod.GET)
public ModelAndView home(@RequestParam("TOKEN") String token) {
    ModelAndView result = new ModelAndView(UserUrl.mainPage);

    result.addObject("TOKEN", token);
    return result;
}

From source file:ems.web.controller.other.HireInitController.java

@RequestMapping(value = "/hireApply", method = RequestMethod.GET)
public ModelAndView initResumeForm(@RequestParam String comName, HttpSession httpSession) {
    int memberCode = ((LoginCompleteDTO) httpSession.getAttribute("loginMember")).getCode();

    return new ModelAndView("/hire/hireApply").addObject("name", comName)
            .addObject("academicAbility", resumeServiceImpl.selectAcademicAbility(memberCode))
            .addObject("license", resumeServiceImpl.selectLicense(memberCode))
            .addObject("career", resumeServiceImpl.selectCareer(memberCode))
            .addObject("memberData", resumeServiceImpl.getResumeInitUserData(
                    ((LoginCompleteDTO) httpSession.getAttribute("loginMember")).getId()));
}

From source file:ua.com.codefire.testhiber.web.IndexController.java

@RequestMapping(value = "/index", method = RequestMethod.GET)
public ModelAndView getIndex() {
    ModelAndView mav = new ModelAndView("index");
    mav.addObject("studentList", studentRepository.findAll());

    return mav;//ww w .  java2  s . c om
}

From source file:ua.aits.oblenergo_site.controller.MainController.java

@RequestMapping(value = { "/index", "/main", "/home" }, method = RequestMethod.GET)
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws SQLException,
        ClassNotFoundException, InstantiationException, IllegalAccessException, ParseException {
    ModelAndView model = new ModelAndView("index");
    return model;
}

From source file:com.library.bookarticlelibrary.controller.AuthorsController.java

@RequestMapping(value = "/authors", method = RequestMethod.GET)
public ModelAndView displayAuthors() {
    ModelAndView model = new ModelAndView("authors");
    List<Author> authorList = authorDao.list();
    model.addObject("title", "authors");
    model.addObject("authorList", authorList);

    return model;
}

From source file:com.test1.controller.IndexController.java

@RequestMapping(value = "/loginSubmit", method = RequestMethod.POST)
public ModelAndView login(@RequestParam("username") String username,
        @RequestParam("password") String password) {
    ModelAndView mav = new ModelAndView("index");
    try {//from   ww w.  j a  v a 2s .  c  om
        UserDAO userDao = new UserDAO();
        if (userDao.findUser(username, password)) {
            mav.setViewName("redirect:home");
            mav.addObject("userId", userDao.getUser(username).getId());
        }
    } catch (Exception ex) {
        System.out.println(ex);
    }
    return mav;
}

From source file:web.mvc.controllers.HelloController.java

@RequestMapping("/goodbye")
public ModelAndView showGoodbyePage(String name) {
    ModelAndView mav = new ModelAndView("hello-page");
    mav.addObject("message", "Goodbye user! " + name + '!');
    return mav;//from w ww . java  2s  .c o  m
}

From source file:uta.ak.usttmp.console.controller.TopicTrackingController.java

@RequestMapping("/trackingTopic")
public ModelAndView trackingTopic(String taskId) {

    String sql = "select * from c_miningtask where mme_eid=?";
    MiningTask task = (MiningTask) usttmpJdbcTemplate.queryForObject(sql, new MiningTaskRowMapper(), taskId);

    ModelAndView mav = new ModelAndView("trackingTopic");
    mav.addObject("task", task);
    mav.addObject("basicWidth", task.getQrtzJobExecCount() * 500);
    mav.addObject("basicHeight", task.getTopicNum() * 50);
    mav.addObject("topicNum", task.getTopicNum());
    return mav;// w ww  . j  a v  a2 s  . c om
}