Example usage for org.springframework.ui ModelMap ModelMap

List of usage examples for org.springframework.ui ModelMap ModelMap

Introduction

In this page you can find the example usage for org.springframework.ui ModelMap ModelMap.

Prototype

public ModelMap() 

Source Link

Document

Construct a new, empty ModelMap .

Usage

From source file:ControllersTest.AdListControllerTest.java

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    map = new ModelMap();
    request = new MockHttpServletRequest();
}

From source file:com.anuz.dummyclient.controller.api.ClientController.java

@RequestMapping(value = "/html_update/{clientId}", method = RequestMethod.GET)
public ResponseEntity getHTMLUpdates(@PathVariable("clientId") int clientId) {
    System.out.println("Check");
    String url = "http://192.168.0.112:8080/DummyAPI/api/v1/users/" + clientId + "/html/latest";
    ModelMap map = new ModelMap();
    map.addAttribute("updates", clientService.htmtUpdates(url));
    return new ResponseEntity(map, HttpStatus.OK);

}

From source file:ControllersTest.AddControllerTest.java

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    session = new MockHttpSession();
    map = new ModelMap();
    request = new MockHttpServletRequest();
}

From source file:com.garethahealy.eap.frontend.MeController.java

@RequestMapping(value = "/me")
public ModelAndView index() {
    ModelMap model = new ModelMap();
    model.addAttribute("personname", "Gareth");

    return new ModelAndView("site/me", model);
}

From source file:fragment.web.AbstractProfilesControllerTest.java

/**
 * Author: vinayv Description: Test to get ServiceProvider and Customer users profiles
 *//*from  www.  j  a v  a2 s .  c om*/
@SuppressWarnings("unchecked")
@Test
public void testShowProfiles() {

    map = new ModelMap();
    String result = profilesController.showProfiles(null, null, map);
    Assert.assertNotNull(result);
    Assert.assertEquals("profiles.show", result);
    List<ProfileForm> allProfileList = (List<ProfileForm>) map.get("allProfileList");
    Assert.assertNotNull(allProfileList);
    Assert.assertEquals(profileDAO.count(), allProfileList.size());
    List<Profile> globalProfileList = (List<Profile>) profileService.listAllProfilesOfClass(Scope.GLOBAL);
    List<ProfileForm> opsProfileList = (List<ProfileForm>) map.get("opsProfileList");
    Assert.assertEquals(globalProfileList.size(), opsProfileList.size());
    List<Profile> tenantProfileList = (List<Profile>) profileService.listAllProfilesOfClass(Scope.TENANT);
    List<ProfileForm> nonOpsProfileList = (List<ProfileForm>) map.get("nonOpsProfileList");
    Assert.assertEquals(tenantProfileList.size(), nonOpsProfileList.size());
    String profileID = (String) map.get("selectedProfile");
    Assert.assertEquals(null, profileID);
}

From source file:org.energyos.espi.datacustodian.web.customer.MeterReadingControllerTest.java

@Test
public void show_displaysShowView() {
    MeterReadingController controller = new MeterReadingController();
    controller.setMeterReadingService(mock(MeterReadingService.class));

    assertEquals("/customer/meterreadings/show", controller.show(1L, 1L, 1L, new ModelMap()));
}

From source file:org.esupportail.dining.web.controllers.HelpController.java

@RequestMapping
public ModelAndView renderHelpView() throws Exception {
    /*//  ww  w.  j  a  v  a 2s.c  om
     * Send nutrition code to the view in order to display them to the user
     * with definitions
     */

    ModelMap model = new ModelMap();
    int[] code = { 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15 };
    model.put("code", code);
    return new ModelAndView("help", model);
}

From source file:org.openmrs.module.patientflags.web.ManageTagsController.java

/**
 * Displays a list of all Patient Tags// w ww .  j a v a2  s .c o m
 * 
 * @return new ModelAndView
 */
@RequestMapping("/module/patientflags/manageTags.list")
public ModelAndView showFlags() {
    ModelMap model = new ModelMap();
    List<Tag> tags = Context.getService(FlagService.class).getAllTags();
    if (tags != null)
        model.addAttribute("tags", tags);

    return new ModelAndView("/module/patientflags/manageTags", model);
}

From source file:net.awired.visuwall.server.web.controller.MainController.java

@RequestMapping
public ModelAndView getWall() throws Exception {

    ModelMap modelMap = new ModelMap();

    modelMap.put("jsLinks", jsService.getJsLinks("res/"));
    modelMap.put("cssLinks", cssService.getCssLinks("res/"));

    return new ModelAndView("index", modelMap);
}

From source file:org.openmrs.module.patientflags.web.ManagePrioritiesController.java

/**
 * Displays a list of Priorities, and allows for editing of ranks
 * //ww  w.  ja  v a 2s .co m
 * @return new ModelAndView
 */

@RequestMapping("/module/patientflags/managePriorities.list")
public ModelAndView showPriorities() {
    ModelMap model = new ModelMap();
    List<Priority> priorities = Context.getService(FlagService.class).getAllPriorities();
    if (priorities != null)
        model.addAttribute("priorities", priorities);

    // add the command object for the filter form
    //model.addAttribute("filter", new Filter());

    return new ModelAndView("/module/patientflags/managePriorities", model);
}