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.dub.skoolie.web.controller.system.people.students.SystemStudentController.java

@RequestMapping(value = "/system/people/students/student", method = RequestMethod.GET)
public ModelAndView getStudents(Model model) {

    return new ModelAndView("");
}

From source file:com.example.session.app.account.IllegalOperationExceptionHandler.java

@ExceptionHandler({ IllegalOperationException.class })
@ResponseStatus(HttpStatus.BAD_REQUEST)//from   w w  w  .j a  v a 2  s  . c  o m
ModelAndView handleOrderException(IllegalOperationException e) {
    return new ModelAndView("common/error/illegalOperationError").addObject(e.getResultMessages());
}

From source file:controllers.AdministratorController.java

@RequestMapping("/action-1")
public ModelAndView action1() {
    ModelAndView result;/* w  ww.j a va 2 s.c  o m*/

    result = new ModelAndView("administrator/action-1");

    return result;
}

From source file:kz.controller.indexController.java

@RequestMapping(value = "/index.htm", method = RequestMethod.GET)
public ModelAndView index(Model model) throws SQLException {
    ModelAndView mv = new ModelAndView("index");
    ThemesDAO all_themes = new ThemesDAOImpl();
    mv.addObject("themes", all_themes.getAll());
    return mv;//from  ww w . jav  a  2s.c  om
}

From source file:org.freeeed.search.web.controller.LogoutController.java

@Override
public ModelAndView execute() {
    log.debug("Logout called!");

    HttpSession session = request.getSession();
    session.removeAttribute(WebConstants.LOGGED_SITE_VISITOR_SESSION_KEY);

    this.loggedSiteVisitor = null;

    return new ModelAndView(WebConstants.LOGOUT_PAGE);
}

From source file:org.antbear.jee.spring.FirstController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public ModelAndView homepageHandler() {
    ModelAndView mav = new ModelAndView("first"); // Logical view name
    mav.addObject(new First());
    return mav;// ww w  . j  a v  a  2s  . co m
}

From source file:controller.set.java

@Override
public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {

    ModelAndView m = new ModelAndView("set");
    String docid = hsr.getParameter("id");
    String start = hsr.getParameter("start");
    String end = hsr.getParameter("end");
    String dates = hsr.getParameter("date");

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    Date d = sdf.parse(dates);/*from  www.j av  a  2  s. c om*/

    SimpleDateFormat f = new SimpleDateFormat("HH:mm:ss");
    Date s = f.parse(start);

    SimpleDateFormat ef = new SimpleDateFormat("HH:mm:ss");
    Date e = f.parse(end);

    long pateientidentifier = 34343;
    int appointment = 324;

    int subjectid = 0;
    if (docid != null && !docid.isEmpty())
        subjectid = Integer.parseInt(docid.trim());

    //String city = hsr.getParameter("doctordepartment");
    Appointments a = new Appointments();
    Session sessionx = HibernateUtil.getSessionFactory().getCurrentSession();
    sessionx.beginTransaction();
    a.setAppointmentid(appointment);
    a.setDate(d);
    a.setDocid(subjectid);
    a.setTimeofday("Morning");
    a.setStarttime(s);
    a.setEndtime(e);
    a.setPateientidentifier(pateientidentifier);
    sessionx.save(a);

    sessionx.getTransaction().commit();
    //return new ModelAndView(new RedirectView("home.htm"));

    return new ModelAndView(new RedirectView("home.htm"));

}

From source file:com.leapfrog.sms.controller.admin.CourseController.java

@RequestMapping(value = "table", method = RequestMethod.GET)
public ModelAndView table() {
    ModelAndView mv = new ModelAndView("admin/course/table");
    mv.addObject("courses", courseService.getAll());

    return mv;/* ww  w . j a v a 2 s.  c om*/
}

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

@RequestMapping(value = "/getPoi", params = "id")
public ModelAndView getPoi(@RequestParam(value = "id") String id) {

    //Creo la view che sar mostrata all'utente
    ModelAndView model = new ModelAndView("infopoi");
    ModelAndView error = new ModelAndView("errorViewPoi");
    CompletePOI poi = pm.getCompletePoiById(id);
    //aggiungo il poi al model
    model.addObject("poi", poi);
    try {/*from  w  ww.  ja v  a2s. c o m*/
        //ciclo sulle componenti del poi
        for (AbstractPoiComponent comp : poi.getComponents()) {

            //associazione delle componenti al model tramite lo slug
            String slug = comp.slug();
            int index = slug.lastIndexOf(".");
            String cname = slug.substring(index + 1).replace("Component", "").toLowerCase();

            Class c = Class.forName(slug);
            model.addObject(cname, c.cast(comp));

        }
    } catch (Exception e) {
        return error;
    }
    return model;
}

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

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