title: Spring Boot Exception evaluating SpringEL expression
body: <blockquote>
    <p>ERROR 4904 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine<br>
    : [THYMELEAF][http-nio-8080-exec-1] Exception processing template
    "index": An error happened during template parsing (template: "class
    path resource [templates/index.html]")</p>
    
    <p>org.thymeleaf.exceptions.TemplateInputException: An error happened
    during template parsing (template: "class path resource
    [templates/index.html]")  at
    org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241)
    ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]    at
    org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100)
    ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]    at
    org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666)
    ~[thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]    at
    org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098)
    [thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]     at
    org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072)
    [thymeleaf-3.0.11.RELEASE.jar:3.0.11.RELEASE]     at
    org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:362)
    [thymeleaf-spring5-3.0.11.RELEASE.jar:3.0.11.RELEASE]     at
    org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:189)
    [thymeleaf-spring5-3.0.11.RELEASE.jar:3.0.11.RELEASE]     at
    org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1370)
    [spring-webmvc-5.1.3.RELEASE.jar:5.1.3.RELEASE]   at
    org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1116)
    [spring-webmvc-5.1.3.RELEASE.jar:5.1.3.RELEASE]   at
    org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055)
    [spring-webmvc-5.1.3.RELEASE.jar:5.1.3.RELEASE]   at
    org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    [spring-webmvc-5.1.3.RELEASE.jar:5.1.3.RELEASE]   at
    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
    [spring-webmvc-5.1.3.RELEASE.jar:5.1.3.RELEASE]   at
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
    [spring-webmvc-5.1.3.RELEASE.jar:5.1.3.RELEASE]</p>
  </blockquote>
  
  <hr>
  
  <blockquote>
    <p>Caused by: org.attoparser.ParseException: Exception evaluating
    SpringEL expression: "#authorization.expression('isAuthenticated()')
    and #authorization.expression('hasAuthority(''USER'')')" (template:
    "fragments/navbar" - line 8, col 15)</p>
  </blockquote>
  
  <hr>
  
  <p>Pom.xml</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;
          &lt;artifactId&gt;thymeleaf-extras-springsecurity4&lt;/artifactId&gt;
          &lt;version&gt;3.0.1.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
  
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <hr>
  
  <p>Problem comes from here when I try to check the authority </p>
  
  <pre><code>&lt;html lang="en" xmlns="w3.org/1999/xhtml" xmlns:th="thymeleaf.org"&gt; 
  &lt;th:block th:fragment="navbar"&gt;
      &lt;th:block if:sec:authorize="isAnonymous()"&gt;
          &lt;th:block th:replace="fragments/navbar-guest"&gt;&lt;/th:block&gt;
      &lt;/th:block&gt;
      &lt;th:block th:if="${#authorization.expression('isAuthenticated()') and #authorization.expression('hasAuthority(''USER'')')}"&gt;
          &lt;th:block th:replace="fragments/navbar-user"&gt;&lt;/th:block&gt;
      &lt;/th:block&gt;
      &lt;th:block th:if="${#authorization.expression('isAuthenticated()') and #authorization.expression('hasAuthority(''ADMIN'')')}"&gt;
          &lt;th:block th:replace="fragments/navbar-admin"&gt;&lt;/th:block&gt;
      &lt;/th:block&gt;
      &lt;th:block th:if="${#authorization.expression('isAuthenticated()') and #authorization.expression('hasAuthority(''MODERATOR'')')}"&gt;
          &lt;th:block th:replace="fragments/navbar-user"&gt;&lt;/th:block&gt;
      &lt;/th:block&gt;
  &lt;/th:block&gt;
  </code></pre>