title: Thymeleaf Could not parse as expression when trying to change background color
body: <p>I am trying to change the background of a div depending of a variable <code>systemStatus</code> from an object taken from a database.</p>
  <pre><code>th:style=&quot;${system.systemStatus} == 1} ? 'background: green' : 'background: red'&quot;
  </code></pre>
  <p>But I get the error:</p>
  <pre><code>org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: &quot;${system.systemStatus} == 1} ? 'background: green' : 'background: red'&quot; (template: &quot;system-management&quot; - line 48, col 41)
  </code></pre>
  <p>I've tried to make a function to get <code>systemStatus</code> as a string:</p>
  <pre><code>th:style=&quot;${system.systemStatusString()} == '1'} ? 'background: green' : 'background: red'&quot;
  </code></pre>
  <p>but I get the same error.</p>
  <p>The whole div:</p>
  <pre><code>&lt;div class=&quot;form-group&quot; th:style=&quot;${system.systemStatus} == 1} ? 'background: green' : 'background: red'&quot;&gt;
      &lt;label for=&quot;id&quot;&gt;ID: &lt;/label&gt;
      &lt;input type=&quot;text&quot; th:value=&quot;${system.id}&quot; th:name=&quot;id&quot; th:id=&quot;id&quot;  class=&quot;form-control&quot; id=&quot;id&quot; readonly /&gt;
      &lt;br&gt;
      &lt;label for=&quot;machineId&quot;&gt;Machine ID: &lt;/label&gt;
      &lt;input type=&quot;text&quot; th:value=&quot;${system.machineId}&quot; th:name=&quot;machineId&quot; th:id=&quot;machineId&quot;  class=&quot;form-control&quot; id=&quot;machineId&quot;/&gt;
  &lt;/div&gt;
  </code></pre>