// if there was no menuStringRenderer put in place, now try finding the request/response in the context and creating a new one
if (menuStringRenderer == null) {
HttpServletRequest request = (HttpServletRequest) context.get("request");
HttpServletResponse response = (HttpServletResponse) context.get("response");
if (request != null && response != null) {
menuStringRenderer = new HtmlMenuRenderer(request, response);
}
}
// still null, throw an error
if (menuStringRenderer == null) {
throw new IllegalArgumentException("Could not find a menuStringRenderer in the context, and could not find HTTP request/response objects need to create one.");