title: Execute jsp in Spring controller and get response html
body: <p>How can I execute a JSP in controller and get html response in Sring variable without using <code>HtmlServletRequestWrapper</code></p>
  
  <p>following is my code, i am trying to hit jsp get response html str and pass that html string to itext to generate pdf.</p>
  
  <pre><code>@RequestMapping(value = "/dosomething", method = RequestMethod.GET)
  public void dosomething(HttpServletRequest request, HttpServletResponse response)  throws IOException {
      // setup your Cookie here
      response.setCookie(cookie)
      request.getRequestDispatcher("/WEB-INF/jsp/account_summary.jsp").include(request, response)
  
  }
  </code></pre>