title: How do I check if an <s:message /> has been set in JSF?
body: <p>I have the following two files (JSF 1.2) to build a form:</p>
  
  <pre><code>&lt;!-- segment of form.xhtml --&gt;
  &lt;s:decorate template="edit.xhtml"&gt;
      &lt;h:inputText label="First Name" id="firstName" required="true" value="#{contactBean.firstName}"&gt;
          &lt;f:validateLength minimum="1" maximum="25"/&gt;
      &lt;/h:inputText&gt;
  &lt;/s:decorate&gt;
  
  &lt;!-- segment of edit.xhtml --&gt;
  &lt;s:validateAll&gt;
      &lt;ui:insert /&gt;
  &lt;/s:validateAll&gt;
  
  &lt;h:graphicImage value="/images/errorIcon.png" rendered="#{when we have a message for this input}" /&gt;
  &lt;s:message /&gt;
  </code></pre>
  
  <p><strong>In <code>edit.xhtml</code>, is there an expression I use in the <code>&lt;h:graphicImage&gt;</code> <code>rendered</code> attribute?</strong></p>
  
  <p>I tried <code>rendered="#{invalid}"</code>, but the <code>invalid</code> remains true even after the <code>&lt;s:messages /&gt;</code> are cleared. This results in the <code>errorIcon.png</code> being displayed without an associated <code>&lt;s:message /&gt;</code>.</p>
  
  <p>Let me know if I'm taking entirely the wrong approach.</p>