use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class ReportsCategoryDeleteController method processFormSubmit.
@RequestMapping(method = RequestMethod.POST)
public ModelAndView processFormSubmit(@RequestParam(value = CANCEL_PARAM, required = false) String cancel, @ModelAttribute("reportCategory") @Valid ReportCategoryFormBean reportCategory, SessionStatus status) {
ModelAndView modelAndView = new ModelAndView(REDIRECT_TO_ADMIN_SCREEN);
if (StringUtils.isNotBlank(cancel)) {
modelAndView.setViewName(REDIRECT_TO_ADMIN_SCREEN);
}
status.setComplete();
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class SystemInformationController method viewSystemInformation.
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "NP_UNWRITTEN_FIELD", justification = "request is not null")
@RequestMapping(method = RequestMethod.GET)
public ModelAndView viewSystemInformation(HttpServletRequest request) {
ServletContext context = request.getSession().getServletContext();
RequestContext requestContext = new RequestContext(request);
Locale locale = requestContext.getLocale();
SystemInformationDto systemInformationDto = systemInformationServiceFacade.getSystemInformation(context, locale);
Map<String, Object> model = new HashMap<String, Object>();
model.put("request", request);
model.put("systemInformationDto", systemInformationDto);
Map<String, Object> status = new HashMap<String, Object>();
List<String> errorMessages = new ArrayList<String>();
status.put("errorMessages", errorMessages);
ModelAndView modelAndView = new ModelAndView("systemInformation", "model", model);
modelAndView.addObject("status", status);
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class GenericController method handleRequestInternal.
@Override
@RequestMapping(value = { "/accessDenied.ftl", "/pageNotFound.ftl", "/ping.ftl", "/cheetah.css.ftl", "/gazelle.css.ftl", "/adminHome.ftl", "/maincss.css", "/screen.css", "/maincss.css.ftl", "/screen.css.ftl", "/admin.ftl", "/defineLookupOptions.ftl", "/viewChecklists.ftl", "/viewEditCheckLists.ftl", "/viewAdditionalFields.ftl", "/viewReportsTemplates.ftl", "/defineAdditionalFields.ftl", "/defineNewChecklist.ftl", "/redoLoansDisbursal.ftl", "/editAdditionalFields.ftl", "/previewChecklist.ftl", "confirmProductMix.ftl", "confirmSavingsProduct.ftl", "confirmLoanProduct.ftl" })
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) {
Map<String, Object> model = new HashMap<String, Object>();
model.put("request", request);
Map<String, Object> status = new HashMap<String, Object>();
List<String> errorMessages = new ArrayList<String>();
status.put("errorMessages", errorMessages);
ModelAndView modelAndView = new ModelAndView(getPageToDisplay(request), "model", model);
modelAndView.addObject("status", status);
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class HomePageController method showPopulatedForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("customerSearch")
public ModelAndView showPopulatedForm(HttpServletRequest request, HttpServletResponse response, @ModelAttribute("customerSearch") CustomerSearchFormBean customerSearchFormBean) throws MifosException, PersistenceException {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "home", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
Short userId = (short) user.getUserId();
UserDetailDto userDetails = this.centerServiceFacade.retrieveUsersDetails(userId);
modelAndView.addObject("customerSearch", customerSearchFormBean);
boolean isCenterHierarchyExists = configurationServiceFacade.getBooleanConfig("ClientRules.CenterHierarchyExists");
modelAndView.addObject("isCenterHierarchyExists", isCenterHierarchyExists);
if (sitePreferenceHelper.isMobile(request)) {
List<ValueListElement> availibleClientGenders = clientServiceFacade.getClientGenders();
modelAndView.addObject("availibleClientGenders", availibleClientGenders);
HashMap<String, ArrayList<CustomerStatusDetailDto>> customerStates = new HashMap<String, ArrayList<CustomerStatusDetailDto>>();
customerStates.putAll(customerSearchServiceFacade.getAvailibleCustomerStates());
modelAndView.addObject("availibleCustomerStates", customerStates);
}
if (userDetails.isLoanOfficer()) {
loadLoanOfficerCustomersHierarchyForSelectedDay(userId, modelAndView, customerSearchFormBean);
modelAndView.addObject("isLoanOfficer", true);
} else {
modelAndView.addObject("isLoanOfficer", false);
}
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class InitializeApplicationController method handleRequestInternal.
@RequestMapping("/initializeApplication.ftl")
// Reason: here we want to surface a generic exception
@SuppressWarnings("PMD.AvoidThrowingRawExceptionTypes")
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) {
ModelAndView returnValue = new ModelAndView("pageNotFound");
if (TestMode.MAIN == getTestingService().getTestMode()) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
} else {
getTestingService().reinitializeCaches();
Map<String, Object> model = new HashMap<String, Object>();
model.put("request", request);
Map<String, Object> status = new HashMap<String, Object>();
List<String> errorMessages = new ArrayList<String>();
status.put("errorMessages", errorMessages);
ModelAndView modelAndView = new ModelAndView("initializeApplication", "model", model);
modelAndView.addObject("status", status);
returnValue = modelAndView;
}
return returnValue;
}
Aggregations