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.leapfrog.lfaeventmanager.admin.controller.PersonController.java

@RequestMapping(value = "index", method = RequestMethod.GET)
public ModelAndView index() {
    ModelAndView mv = new ModelAndView("person/index");
    mv.addObject("personList", personService.getAll());
    return mv;/*from w  w w  .j  a v a  2 s .c  o m*/
}

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

@RequestMapping("/resumeInit")
public ModelAndView initResumeForm(HttpSession httpSession) {
    int memberCode = ((LoginCompleteDTO) httpSession.getAttribute("loginMember")).getCode();
    return new ModelAndView("/hire/hireResume")
            .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:pl.altkom.text.mvc.spring.controller.PersonController.java

@RequestMapping("/add")
public ModelAndView add() {

    ModelAndView modelAndView = new ModelAndView("add");

    Person person = new Person();
    modelAndView.addObject("person", person);
    modelAndView.addObject("teams", teamDAO.findAll());

    return modelAndView;

}

From source file:com.yahoo.dba.perf.myperf.springmvc.LogoutController.java

@Override
protected ModelAndView handleRequestImpl(HttpServletRequest req, HttpServletResponse resp) throws Exception {
    HttpSession sess = req.getSession();

    //do we have session
    if (sess != null) {
        UserDBConnections conns = UserDBConnections.class.cast(sess.getAttribute("UserDBConnections"));
        sess.removeAttribute("UserDBConnections");
        sess.invalidate();/*from   www .j a va  2s  . c om*/

        new Thread(new LogoutCleaner(conns)).start();//make it async. 
        //TODO Add the thread handle for central process
    }

    ModelAndView mv = new ModelAndView(new RedirectView(this.getNosessView()));
    return mv;
}

From source file:psiprobe.controllers.logs.SetupFollowController.java

@Override
protected ModelAndView handleLogFile(HttpServletRequest request, HttpServletResponse response,
        LogDestination logDest) throws Exception {

    File logFile = logDest.getFile();
    List<LogDestination> sources = getLogResolver().getLogSources(logFile);
    return new ModelAndView(getViewName()).addObject("log", logDest).addObject("sources", sources);
}

From source file:controller.AppController.java

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

From source file:com.faisal.controllers.HelloWorld.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView getdata() {
    System.out.println("-------------------ccccccccccccc----------------");
    List<String> list = getList();
    ModelAndView model = new ModelAndView("hello");
    model.addObject("msg", "ni ssss");
    model.addObject("lists", list);
    model.addObject("student", new Student());
    model.addObject("list", getStudentsList());
    //        Student s = studentDao.findStudent("faisal");
    //        System.out.println(s.getLastName());
    //        model.addObject("name", s.getFirstName()+ " "+s.getLastName());
    return model;

}

From source file:controller.NuevaPersona.java

@Override
protected ModelAndView onSubmit(Object command) throws Exception {
    Persona per = (Persona) command;/*from  w w  w. j a  va 2  s  .c  om*/
    try {
        Session sesion = HibernateUtil.getSessionFactory().getCurrentSession();
        sesion.beginTransaction();
        sesion.save(per);
        sesion.getTransaction().commit();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return new ModelAndView(new RedirectView("persona.htm"));
}

From source file:cn.lhfei.ci.rest.web.controller.SystemController.java

/**
 * Login home page./*from ww  w.ja  va  2  s  .  c o  m*/
 * 
 * @return
 */
@RequestMapping(value = "login")
public ModelAndView login() {
    ModelAndView view = new ModelAndView("system/login");

    return view;
}

From source file:com.madadipouya.neatgeoip.rest.HomeRestController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView redirectToDocPage(HttpServletRequest request) {
    return new ModelAndView("redirect:" + request.getScheme() + HOMEPAGE_URL);
}