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:com.MyHistory.Controller.UsuarioController.java

@RequestMapping(value = "/logout", method = RequestMethod.GET)
public ModelAndView cerrarSesion(HttpServletRequest pRequest) {
    HttpSession sesion = pRequest.getSession();
    sesion.invalidate();/*from  w w  w.  j  ava2s .c  o m*/
    ModelAndView model = new ModelAndView();
    model.setViewName("redirect:/login.htm");
    return model;
}

From source file:ilearn.orb.controller.LogInOutController.java

@RequestMapping(value = "/login")
public ModelAndView login() {
    ModelAndView model = new ModelAndView();
    model.setViewName("login");
    return model;
}

From source file:jp.pigumer.app.Hello.java

@RequestMapping("/hello")
public ModelAndView hello(@AuthenticationPrincipal User user) {
    ModelAndView mv = new ModelAndView();
    mv.addObject("user", user.getUsername());
    mv.setViewName("hello");
    return mv;/*ww w .  j a v  a2s.  c o m*/
}

From source file:org.myjerry.evenstar.web.controller.PageNotFoundController.java

@Override
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
    // extract the request URI
    // and check to see if this is a blog page URL
    // if yes - go ahead and display the page
    String uri = request.getRequestURI();

    BlogPost post = this.blogPostService.getPostForURI(uri);
    if (post != null) {
        RequestDispatcher dispatcher = request.getRequestDispatcher(
                "/viewPost.html?postID=" + post.getPostID() + "&blogID=" + post.getBlogID());
        dispatcher.forward(request, response);
        return null;
    }/*from   ww  w.j  a va  2  s  .co m*/

    ModelAndView mav = new ModelAndView();
    mav.setViewName(".page.not.found");
    return mav;
}

From source file:android.apn.androidpn.server.console.controller.NotificationController.java

public ModelAndView send(HttpServletRequest request, HttpServletResponse response) throws Exception {
    String broadcast = ServletRequestUtils.getStringParameter(request, "broadcast", "Y");
    String username = ServletRequestUtils.getStringParameter(request, "username");
    String title = ServletRequestUtils.getStringParameter(request, "title");
    String message = ServletRequestUtils.getStringParameter(request, "message");
    String uri = ServletRequestUtils.getStringParameter(request, "uri");

    String apiKey = Config.getString("apiKey", "");
    logger.debug("apiKey=" + apiKey);

    if (broadcast.equalsIgnoreCase("Y")) {
        notificationManager.sendBroadcast(apiKey, title, message, uri);
    } else {//from   w ww.j ava 2s .  c o m
        notificationManager.sendNotifcationToUser(apiKey, username, title, message, uri);
    }

    ModelAndView mav = new ModelAndView();
    mav.setViewName("redirect:notification.do");
    return mav;
}

From source file:com.br.uepb.controller.LoginController.java

@RequestMapping(value = "/index/login.html", method = RequestMethod.GET)
public ModelAndView cadastrarGet(HttpServletRequest request) {

    ModelAndView modelAndView = new ModelAndView();
    modelAndView.setViewName("index/login");
    modelAndView.addObject("loginDomain", new LoginDomain());
    return modelAndView;
}

From source file:com.ut.healthelink.controller.productSuiteController.java

/**
 * The '' request will display the product suite information page.
 *///  ww w  .j a va 2s.  c  o m
@RequestMapping(value = "", method = RequestMethod.GET)
public ModelAndView productSuite() throws Exception {

    ModelAndView mav = new ModelAndView();
    mav.setViewName("/productSuite");
    mav.addObject("pageTitle", "Product Suite");
    return mav;
}

From source file:com.ut.healthelink.controller.productSuiteController.java

/**
 * The '/health-e-net' request will display the health-e-net information page.
 *///from   www.j  av  a  2 s .c  o  m
@RequestMapping(value = "/health-e-net", method = RequestMethod.GET)
public ModelAndView healthenet() throws Exception {

    ModelAndView mav = new ModelAndView();
    mav.setViewName("/healthenet");
    mav.addObject("pageTitle", "Health-e-Net");
    return mav;
}

From source file:com.ut.healthelink.controller.productSuiteController.java

/**
 * The '/health-e-data' request will display the health-e-data information page.
 *//*from   w  ww  .j  a  v a2s  . c om*/
@RequestMapping(value = "/health-e-data", method = RequestMethod.GET)
public ModelAndView healthedata() throws Exception {

    ModelAndView mav = new ModelAndView();
    mav.setViewName("/healthedata");
    mav.addObject("pageTitle", "Health-e-Data");
    return mav;
}

From source file:com.ut.healthelink.controller.productSuiteController.java

/**
 * The '/health-e-web' request will display the health-e-web information page.
 */// w  ww.j  a v  a 2  s  . c  o m
@RequestMapping(value = "/health-e-web", method = RequestMethod.GET)
public ModelAndView healtheweb() throws Exception {

    ModelAndView mav = new ModelAndView();
    mav.setViewName("/healtheweb");
    mav.addObject("pageTitle", "Health-e-Web");
    return mav;
}