code: @RequestMapping(params = {"query", "hitMaxQueries"})
      public ModelAndView showSearchError(
              PortletRequest request,
              @RequestParam(value = "query") String query,
              @RequestParam(value = "hitMaxQueries") boolean hitMaxQueries) {
  
          final Map<String, Object> model = new HashMap<>();
          model.put("query", query);
          model.put("hitMaxQueries", hitMaxQueries);
  
          final boolean isMobile = isMobile(request);
          String viewName = isMobile ? "/jsp/Search/mobileSearch" : "/jsp/Search/search";
  
          return new ModelAndView(viewName, model);
      }
docs: Display search results