@RequestMapping(value = FoUrls.RETAILER_CONTACT_URL, method = RequestMethod.GET)
public ModelAndView displayContactForm(final HttpServletRequest request, @PathVariable(RequestConstants.URL_PATTERN_RETAILER_CODE) final String retailerCode,
Model model, @ModelAttribute("retailerContactForm") RetailerContactForm retailerContactForm) throws Exception {
ModelAndViewThemeDevice modelAndView = new ModelAndViewThemeDevice(getCurrentVelocityPath(request), FoUrls.RETAILER_CONTACT.getVelocityPage());
final RequestData requestData = requestUtil.getRequestData(request);
final MarketArea currentMarketArea = requestData.getMarketArea();
final Retailer currentRetailer = requestData.getMarketAreaRetailer();
modelAndView.addObject(ModelConstants.URL_BACK, urlService.generateUrl(FoUrls.HOME, requestUtil.getRequestData(request)));
Retailer retailer = retailerService.getRetailerByCode(currentMarketArea.getId(), currentRetailer.getId(), retailerCode);
// SANITY CHECK
if(retailer.getDefaultAddress() == null
|| StringUtils.isEmpty(retailer.getDefaultAddress().getEmail())){
final String url = urlService.generateUrl(FoUrls.RETAILER_DETAILS, requestUtil.getRequestData(request), retailer);