title: Issues calling methods on web context objects in thymeleaf template
body: <p>I am trying to call methods on web context objects such as #request and #response in my templates in thymeleaf 3.0.3 and Spring Boot 1.5.1.</p>
  
  <p>I continually get errors like this:</p>
  
  <p>org.springframework.expression.spel.SpelEvaluationException: EL1011E: Method call: Attempted to call method method(java.lang.String) on null context object</p>
  
  <p>Here is a Controller:</p>
  
  <pre><code>@Controller
  public class Controller {
  
  @RequestMapping(method = RequestMethod.GET, value = "/endpoint", produces = "text/html")
  public String customerServiceSignin(Model uiModel, HttpServletRequest request) {
      uiModel.addAttribute("attr1", true); // show proper header
      uiModel.addAttribute("attr2", false);
      return "template";
  }
  </code></pre>
  
  <p>and a template:</p>
  
  <pre><code>&lt;html xmlns:th="http://www.thymeleaf.org"&gt;
  &lt;div&gt;
  &lt;div style="..."&gt;
  
      &lt;div class="errorblock" th:unless="${#strings.isEmpty(#request.getAttribute('some_attr'))}" th:utext="${#request.getAttribute('some_other_attr')}"&gt;&lt;/div&gt;
  
      &lt;form name='f' action="action" method='POST'&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;User:&lt;/td&gt;
                  &lt;td&gt;&lt;input type='text' name='username' value="" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Password:&lt;/td&gt;
                  &lt;td&gt;&lt;input type='password' name='password' /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;input name="submit" type="submit" value="submit" /&gt;
                  &lt;/td&gt;
                  &lt;td&gt;&lt;input name="reset" type="reset" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is one example, but anywhere I attempt to do this I get these errors. Is there a piece I am missing?</p>