title: Thymeleaf: Concatenation - Could not parse as expression
body: <p>I'm having an issue when trying to concat multiple values in my template.
  According to Thymeleaf <a href="http://www.thymeleaf.org/doc/Tutorial%20-%20Using%20Thymeleaf%2020130224.pdf" rel="noreferrer">here</a> I should simply be able to + them together...</p>
  
  <blockquote>
    <p><strong>4.6 CONCATENATING TEXTS</strong></p>
    
    <p>Texts, no matter whether they are literals or the result of evaluating variable or message
    expressions, can be easily concatenated using the + operator:</p>
  </blockquote>
  
  <pre><code>th:text="'The name of the user is ' + ${user.name}"
  </code></pre>
  
  <p>Here is an example of what I found works:</p>
  
  <pre><code>&lt;p th:text="${bean.field} + '!'"&gt;Static content&lt;/p&gt;
  </code></pre>
  
  <p>This however doesn't:</p>
  
  <pre><code>&lt;p th:text="${bean.field} + '!' + ${bean.field}"&gt;Static content&lt;/p&gt;
  </code></pre>
  
  <p>Logically, this should work but its not, what am I doing wrong?</p>
  
  <hr>
  
  <p>Maven:
  </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
      &lt;artifactId&gt;thymeleaf-spring3&lt;/artifactId&gt;
      &lt;version&gt;2.0.16&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <hr>
  
  <p>Here is how I've set my TemplateEngine and TemplateResolver up:
  </p>
  
  <pre><code>&lt;!-- Spring config --&gt;
  &lt;bean id="templateResolver" class="org.thymeleaf.templateresolver.ClassLoaderTemplateResolver"&gt;
      &lt;property name="suffix" value=".html"/&gt;
      &lt;property name="templateMode" value="HTML5"/&gt;
      &lt;property name="characterEncoding" value="UTF-8"/&gt;
      &lt;property name="order" value="1"/&gt;
  &lt;/bean&gt;
  &lt;bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine"&gt;
      &lt;property name="templateResolver" ref="fileTemplateResolver"/&gt;
      &lt;property name="templateResolvers"&gt;
          &lt;list&gt;
              &lt;ref bean="templateResolver"/&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  </code></pre>
  
  <h2>    </h2>
  
  <p>ThymeleafTemplatingService:
  </p>
  
  <pre><code>@Autowired private TemplateEngine templateEngine;
  .....
  String responseText = this.templateEngine.process(templateBean.getTemplateName(), templateBean.getContext());
  </code></pre>
  
  <p>AbstractTemplate.java:
  </p>
  
  <pre><code>public abstract class AbstractTemplate {
    private final String templateName;
    public AbstractTemplate(String templateName){
      this.templateName=templateName;
    }
    public String getTemplateName() {
      return templateName;
    }
    protected abstract HashMap&lt;String, ?&gt; getVariables();
    public Context getContext(){
      Context context = new Context();
      for(Entry&lt;String, ?&gt; entry : getVariables().entrySet()){
        context.setVariable(entry.getKey(), entry.getValue());
      }
      return context;
    }
  }
  </code></pre>