use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class ViewLoanAccountDetailsController method showLoanAccountAllActivity.
@RequestMapping(value = "/viewLoanAccountAllActivity", method = RequestMethod.GET)
public ModelAndView showLoanAccountAllActivity(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountAllActivity", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
modelAndView.addObject("loanInformationDto", loanInformationDto);
modelAndView.addObject("currentDate", new Date());
List<LoanActivityDto> allLoanAccountActivities = this.loanAccountServiceFacade.retrieveAllLoanAccountActivities(globalAccountNum);
request.setAttribute("loanAllActivityView", allLoanAccountActivities);
this.loanAccountServiceFacade.putLoanBusinessKeyInSession(globalAccountNum, request);
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class DefineProductCategoryPreviewControllerTest method cancelShouldRedirectToAdminView.
@Test
public void cancelShouldRedirectToAdminView() throws Exception {
// setup
ProductCategoryFormBean expectedFormBean = new ProductCategoryFormBean();
// exercise test
ModelAndView returnedView = productCategoryPreviewController.processFormSubmit("Cancel", "", expectedFormBean, bindingResult);
// verification
Assert.assertThat(returnedView.getViewName(), is(ADMIN_VIEW));
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class RedirectionControllerTest method testHandleRequest.
@Test
public void testHandleRequest() throws ServletException, IOException {
String expectedPageToRedirectTo = "foopage";
RedirectionController controller = new RedirectionController();
controller.setViewToRedirectTo(expectedPageToRedirectTo);
MockHttpServletRequest mockRequest = new MockHttpServletRequest();
MockHttpServletResponse mockResponse = new MockHttpServletResponse();
ModelAndView modelAndView = controller.handleRequest(mockRequest, mockResponse);
Assert.assertEquals(expectedPageToRedirectTo, modelAndView.getViewName());
Assert.assertNotNull(modelAndView.getModel());
Map<String, Object> modelMap = (Map<String, Object>) modelAndView.getModel().get("model");
Object response = modelMap.get("response");
Assert.assertNotNull(response);
Assert.assertEquals(MockHttpServletResponse.class, response.getClass());
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class ViewOrganizationSettingsController method handleRequestInternal.
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "NP_UNWRITTEN_FIELD", justification = "request is not null")
@RequestMapping(method = RequestMethod.GET)
public ModelAndView handleRequestInternal(HttpServletRequest request) {
ModelAndView modelAndView = new ModelAndView("viewOrganizationSettings");
Properties p = viewOrganizationSettingsServiceFacade.getOrganizationSettings(request.getSession());
modelAndView.addObject("properties", p);
modelAndView.addObject("pluginsPropsMap", viewOrganizationSettingsServiceFacade.getDisplayablePluginsProperties());
modelAndView.addObject("breadcrumbs", new AdminBreadcrumbBuilder().withLink("admin.viewOrganizationSettings", "viewOrganizationSettings.ftl").build());
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class ViewProductCategoriesController method showProductCategories.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView showProductCategories() {
ModelAndView modelAndView = new ModelAndView("viewProductCategories");
ProductCategoryDisplayDto dto = adminServiceFacade.retrieveAllProductCategories();
modelAndView.addObject("dto", dto);
modelAndView.addObject("breadcrumbs", new AdminBreadcrumbBuilder().withLink("admin.viewproductcategories", "viewProductCategories.ftl").build());
return modelAndView;
}
Aggregations