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:team.curise.controller.GetController.java

@RequestMapping("/saleRate")
public ModelAndView saleRate() {
    ModelAndView mv = new ModelAndView();
    mv.setViewName("saleRate");
    return mv;//from   w w  w . jav  a2  s. co m
}

From source file:team.curise.controller.GetController.java

@RequestMapping("/thingsConsume")
public ModelAndView thingsConsume() {
    ModelAndView mv = new ModelAndView();
    mv.setViewName("thingsConsume");
    return mv;/*  w  w w. jav a 2  s  . c  o  m*/
}

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

@RequestMapping(value = "/TopicsCommentTest", method = RequestMethod.GET)
public ModelAndView viewTopicsCommentTest() {
    ModelAndView mav = new ModelAndView();
    mav.setViewName("TopicsCommentTest");
    return mav;//from   w  ww .java 2  s  .c om
}

From source file:team.curise.controller.GetController.java

@RequestMapping("/login")
public ModelAndView login() {
    ModelAndView mv = new ModelAndView();
    mv.setViewName("login");
    System.out.println("lllllllllll");
    return mv;//from ww w . j  a  v  a 2 s  .co  m
}

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

@RequestMapping(value = "/profiles")
public ModelAndView profiles(Locale locale, ModelMap modelMap, HttpSession session) {

    ModelAndView model = new ModelAndView();
    model.setViewName("profiles");

    try {/*from  w  ww .  j  a v a2s. c  om*/
        Gson gson = new GsonBuilder().registerTypeAdapter(java.util.Date.class, new UtilDateDeserializer())
                .setDateFormat(DateFormat.LONG).create();
        User[] students = null;
        try {
            String json = UserServices.getProfiles(Integer.parseInt(session.getAttribute("id").toString()),
                    session.getAttribute("auth").toString());
            students = gson.fromJson(json, User[].class);
        } catch (NullPointerException e) {
        }
        if (students == null || students.length == 0) {
            students = HardcodedUsers.defaultStudents();
        }
        modelMap.put("students", students);

    } catch (NumberFormatException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return model;

}

From source file:ru.langboost.controllers.security.SecurityController.java

@RequestMapping(value = "/login", method = RequestMethod.GET)
public ModelAndView login() {
    ModelAndView model = new ModelAndView();
    model.addObject("credentials", new Credentials());
    model.setViewName("security/login");
    return model;
}

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

/**
 * Mapping de l'action de dconnexion//  w w w  . ja  va2  s .c o m
 * @return la page login
 */
@RequestMapping(value = "/logout", method = RequestMethod.GET)
public ModelAndView logoutUser() {
    ModelAndView mav = new ModelAndView();
    mav.setViewName("connexion_login");

    return mav;
}

From source file:mx.com.gaby.controller.HomeController.java

@RequestMapping("/index")
public ModelAndView index() {
    System.out.println("INDEX");
    ModelAndView modelAndview = new ModelAndView();

    testAsynch.procesar();//from  w w  w  .  ja v  a 2  s. c o m

    modelAndview.setViewName("index");

    return modelAndview;
}

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

/**
 * The '/associations/ORG NAME' Post request will get the details of the passed in orgId
 * /*ww  w.j  a  v a2 s .c  o m*/
 * @param orgId The id of the selected organization
 * 
 * @return The details page of the selected organization
 * 
 */
@RequestMapping(value = "/{orgName}", method = RequestMethod.POST)
public ModelAndView viewOrgDetails(HttpServletRequest request, HttpServletResponse response,
        HttpSession session, @RequestParam Integer orgId) throws Exception {

    ModelAndView mav = new ModelAndView();
    mav.setViewName("/organizations/associated/orgDetails");

    Organization orgDetails = null;

    try {

        orgDetails = organizationManager.getOrganizationById(orgId);
        mav.addObject("orgDetails", orgDetails);

        List<Provider> providers = organizationManager.getOrganizationProviders(orgDetails.getId());

        if (!providers.isEmpty()) {

            for (Provider provider : providers) {

                List<providerAddress> addresses = providerManager.getProviderAddresses(provider.getId());

                provider.setProviderAddresses(addresses);

                List<providerIdNum> ids = providerManager.getProviderIds(provider.getId());

                provider.setProviderIds(ids);

            }

        }

        mav.addObject("providers", providers);

        /* Get a list of main contacts */
        List<User> mainContacts = userManager.getOrganizationContact(orgDetails.getId(), 1);
        mav.addObject("mainContacts", mainContacts);

        /* Get a list of secondary contacts */
        List<User> secondaryContacts = userManager.getOrganizationContact(orgDetails.getId(), 2);
        mav.addObject("secondaryContacts", secondaryContacts);

        return mav;

    } catch (Exception e) {
        throw new Exception("Error trying to list the organization details. OrgId: " + orgDetails.getId(), e);
    }

}

From source file:net.cit.tetrad.resource.CommandResource.java

@RequestMapping("/commamdView.do")
public ModelAndView commamdView(CommonDto dto) throws Exception {
    log.debug("start - commamdView()");
    ModelAndView mav = new ModelAndView();
    mav.addObject("comm", dto);
    mav.setViewName("commandView");

    log.debug("end - commamdView()");
    return mav;/*from w ww . j  av a 2s  . c  o  m*/
}