title: Casting from HttpServletRequest to WebRequest
body: <p>I've generated a Spring Boot web application using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.</p>
  
  <p>Technologies used:</p>
  
  <p>Spring Boot 2.0.0.M6 , Java 8, maven</p>
  
  <p>I have this method in 1 of the class</p>
  
  <pre><code>private Map&lt;String, Object&gt; getErrorAttributes(HttpServletRequest request,
                                                     boolean includeStackTrace) {
  
          RequestAttributes requestAttributes = new ServletRequestAttributes(request);
          return this.errorAttributes.getErrorAttributes(request, includeStackTrace)
  
      }
  </code></pre>
  
  <p>But I don't know how to cast from <code>javax.servlet.http HttpServletRequest</code> <code>org.springframework.web.context.request.WebRequest</code></p>
  
  <pre><code>The method getErrorAttributes(WebRequest, boolean) in the type ErrorAttributes is not applicable for the arguments (HttpServletRequest, 
       boolean)
  </code></pre>