Example usage for org.springframework.web.servlet ModelAndView setViewName

List of usage examples for org.springframework.web.servlet ModelAndView setViewName

Introduction

In this page you can find the example usage for org.springframework.web.servlet ModelAndView setViewName.

Prototype

public void setViewName(@Nullable String viewName) 

Source Link

Document

Set a view name for this ModelAndView, to be resolved by the DispatcherServlet via a ViewResolver.

Usage

From source file:org.openmrs.module.vcttrac.web.controller.VCTGraphicalStatisticPerDayController.java

/**
 * @see org.springframework.web.servlet.mvc.ParameterizableViewController#handleRequestInternal(javax.servlet.http.HttpServletRequest,
 *      javax.servlet.http.HttpServletResponse)
 *///from ww  w  .  j a v  a  2s  .  c  o m
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
        throws Exception {
    ModelAndView mav = new ModelAndView();
    mav.addObject("todayDate", Context.getDateFormat().format(new Date()));
    mav.setViewName(getViewName());

    return mav;
}

From source file:com.jaspersoft.jasperserver.war.control.SchedulerController.java

public ModelAndView jobdetails(HttpServletRequest request, HttpServletResponse response) throws Exception {

    ModelAndView mav = new ModelAndView();
    mav.setViewName("modules/reportScheduling/jobDetails");

    if (request.getParameter("id") != null) {
        long jobId = Long.parseLong(request.getParameter("id"));
        log.info("jobdetails for job " + jobId);

        ReportJob job = getScheduler().getScheduledJob(null, jobId);
        mav.addObject("job", job);

    }/* w w w. j  av a  2s .  c  om*/
    return mav;
}

From source file:com.klm.workshop.controller.participant.BusinessAndObjectivesController.java

/**
 * Show form to create a business objective
 *
 * @param model Objects and view//from www.  ja va  2  s  .  c  om
 * @return Form to create a business objective
 */
@RequestMapping(value = "/business-objectives/create", method = RequestMethod.GET)
public ModelAndView create(ModelAndView model) {
    model.addObject("workshopStep", CURRENT_STEP);
    model.setViewName("participant/business-objectives/create");
    return model;
}

From source file:com.klm.workshop.controller.participant.IdeateController.java

/**
 * Show form to create a ideate sentence
 *
 * @param model Objects and view/*from  w  w  w . j a  v  a 2 s. c  o m*/
 * @return Form to create a ideate sentence
 */
@RequestMapping(value = "/ideate/create", method = RequestMethod.GET)
public ModelAndView create(ModelAndView model) {
    model.addObject("workshopStep", CURRENT_STEP);
    model.setViewName("participant/ideate/create");
    return model;
}

From source file:com.klm.workshop.controller.participant.MixAndMatchController.java

/**
 * Show form to create a mix and match sentence
 * /*from  w w w . j ava 2s . c o m*/
 * @param model Objects and view
 * @return Form to create a mix and match sentence
 */
@RequestMapping(value = "/mix-and-match/create", method = RequestMethod.GET)
public ModelAndView create(ModelAndView model) {
    model.addObject("workshopStep", CURRENT_STEP);
    model.setViewName("participant/mix-and-match/create");
    return model;
}

From source file:com.miko.demo.neo4j.controller.MainController.java

@RequestMapping(value = "entityA", method = RequestMethod.GET)
public ModelAndView getEntityAMain(ModelAndView model) {
    model.addObject("message", "Hello Spring 4 Neo4J Demo and AngularJS!");
    model.setViewName("hello");
    return model;
}

From source file:com.klm.workshop.controller.participant.TargetAudienceController.java

/**
 * Show form with an overview of the target audience
 * //from   www.j  a  v a  2 s .c om
 * @param model Objects and view
 * @return Form with an overview of the target audience
 */
@RequestMapping(value = "/target-audience/index", method = RequestMethod.GET)
public ModelAndView index(ModelAndView model) {
    model.addObject("workshopStep", CURRENT_STEP);
    model.setViewName("participant/target-audience/index");

    return model;
}

From source file:com.klm.workshop.controller.participant.TargetAudienceController.java

/**
 * Show form to create a target audience
 * //from w w w  . j  a va2 s  . c  o  m
 * @param model Objects and view
 * @return Form to create a target audience
 */
@RequestMapping(value = "/target-audience/create", method = RequestMethod.GET)
public ModelAndView create(ModelAndView model) {
    model.addObject("workshopStep", CURRENT_STEP);
    model.setViewName("participant/target-audience/create");

    return model;
}

From source file:com.searchbox.framework.web.HomeController.java

@RequestMapping("/auth/openid")
public ModelAndView home(@RequestParam(required = true) String url, HttpServletRequest request,
        ModelAndView model) {
    model.setViewName("util/autologin");
    model.addObject("openid_identifier", url);
    return model;
}

From source file:co.com.carpco.altablero.spring.web.controller.TeacherController.java

@RequestMapping(value = "/admin/profesor", method = RequestMethod.GET)
public ModelAndView generalInformation() {
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();

    if (!(auth instanceof AnonymousAuthenticationToken)) {

        ModelAndView model = roleUtils.createModelWithUserDetails(auth.getName());
        model.setViewName("admin/teacher/edit");
        return model;
    } else {/*  w w  w.ja  v  a  2 s.  c o  m*/
        return new ModelAndView("redirect:/login");
    }
}