Example usage for org.springframework.ui Model asMap

List of usage examples for org.springframework.ui Model asMap

Introduction

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

Prototype

Map<String, Object> asMap();

Source Link

Document

Return the current set of model attributes as a Map.

Usage

From source file:org.fenixedu.ulisboa.integration.sas.ui.spring.controller.manageScholarshipReportRequests.ScholarshipReportRequestController.java

private ScholarshipReportRequest getScholarshipReportRequest(Model model) {
    return (ScholarshipReportRequest) model.asMap().get("scholarshipReportRequest");
}

From source file:am.ik.categolj2.app.feed.FeedController.java

@RequestMapping({ "/feed", "/rss" })
public ModelAndView feed(Model model) {
    List<Entry> entries = entryService.findAllPublishedUpdatedRecently();
    model.addAttribute("entries", new FeedEntries(entries));
    return new ModelAndView(rssEntryFeedView, model.asMap());
}

From source file:com.baomidou.framework.mail.MailHelper.java

public boolean sendMail(String personal, String from, String to, String subject, String tplName, Model model) {
    return sendMail(personal, from, new String[] { to }, subject, tplName, model.asMap());
}

From source file:org.fenixedu.ulisboa.integration.sas.ui.spring.controller.manageschoolleveltypemapping.SchoolLevelTypeMappingController.java

private SchoolLevelTypeMapping getSchoolLevelTypeMapping(Model model) {
    return (SchoolLevelTypeMapping) model.asMap().get("schoolLevelTypeMapping");
}

From source file:com.qubit.solution.fenixedu.bennu.webservices.ui.management.webservicesServers.WebServiceServerConfigurationController.java

private WebServiceServerConfiguration getWebServiceServerConfiguration(Model m) {
    return (WebServiceServerConfiguration) m.asMap().get("webServiceServerConfiguration");
}

From source file:com.comcast.video.dawg.controller.park.PopulateControllerTest.java

@Test
public void testPopulateTable() {
    PopulateController controller = new PopulateController();
    ParkService mockParkService = new MockParkService();
    ReflectionTestUtils.setField(controller, "parkService", mockParkService);

    Model model = new BindingAwareModelMap();
    Assert.assertEquals(controller.populateTable(model), "populateTable");
    Assert.assertNotNull(model.asMap().get("population"));
}

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

private String renderView(HttpServletRequest request, String viewName, Model model) throws Exception {
    View resolvedView = viewResolver.resolveViewName(viewName, Locale.US);
    MockHttpServletResponse mockResp = new MockHttpServletResponse();
    resolvedView.render(model.asMap(), request, mockResp);
    return mockResp.getContentAsString();
}

From source file:org.duracloud.account.app.controller.AccountInfoController.java

@RequestMapping(value = INFO_EDIT_MAPPING, method = RequestMethod.GET)
public String getEditForm(@PathVariable Long accountId, Model model) throws AccountNotFoundException {
    log.info("getEditForm account {}", accountId);

    loadAccountInfo(accountId, model);/*from  ww  w .java  2  s  .  c o  m*/
    AccountInfo accountInfo = (AccountInfo) model.asMap().get("accountInfo");

    AccountEditForm editForm = new AccountEditForm();
    editForm.setDepartment(accountInfo.getDepartment());
    editForm.setOrgName(accountInfo.getOrgName());
    editForm.setAcctName(accountInfo.getAcctName());
    model.addAttribute(EDIT_ACCOUNT_INFO_FORM_KEY, editForm);

    return ACCOUNT_INFO_EDIT_ID;
}

From source file:org.jasig.portlet.calendar.mvc.controller.EditCalendarDefinitionController.java

@RequestMapping(params = "action=editCalendarDefinition")
public String showEditCalendarDefinitionForm(PortletRequest request, Model model) {
    CalendarDefinitionForm form = (CalendarDefinitionForm) model.asMap().get(FORM_NAME);
    if (form == null) {
        form = getCalendarDefinitionForm(request);
        model.addAttribute(FORM_NAME, form);
    }//from w  ww .  j  a v  a2 s .co  m
    model.addAttribute("adapter", context.getBean(form.getClassName(), ICalendarAdapter.class));
    model.addAttribute("availableRoles", roleService.getKnownRoles());
    return "/editCalendarDefinition";
}

From source file:videoshop.controller.CatalogControllerIntegrationTests.java

/**
 * Integration test for an individual controller.
 *///from w w  w  .j av a  2 s  . c  o  m
@Test
@SuppressWarnings("unchecked")
public void sampleControllerIntegrationTest() {

    Model model = new ExtendedModelMap();

    String returnedView = controller.blurayCatalog(model);

    assertThat(returnedView, is("discCatalog"));

    Iterable<Object> object = (Iterable<Object>) model.asMap().get("catalog");
    assertThat(object, is(iterableWithSize(9)));
}