title: JSF 1.1: How to display component label instead of clientId in validation messages?
body: <p>I'm writing a custom component to show validation messages in popups, it works well but I have still a problem: I would like to display component labels instead of cliendIds in validation messages.</p>
  
  <p>I already looked at this question and similars:</p>
  
  <p><a href="https://stackoverflow.com/questions/10961284/removing-the-component-id-from-validation-message-when-using-message-bundle-in-j/10961309#10961309">Removing the component Id from validation message when using message bundle in JSF</a></p>
  
  <p>but I'm using jsf 1.1 and I get a compilation error if I try to set a value for attribute <code>label</code> or <code>requiredMessage</code>.
  So I tried assigning a label to the component using an <code>&lt;outputLabel /&gt;</code>:</p>
  
  <pre><code>&lt;h:outputLabel for="phone" value="Phone number" /&gt;
  &lt;h:inputText id="phone" required="true" value="#{backingBean.phoneNumber}" /&gt;
  </code></pre>
  
  <p>with no effect.</p>
  
  <p>Is there a simple way in jsf 1.1 to make label appear in validation messages instead of client id?
  If not, how could I, given a component, retrieve its related label component to do the work in Java code?</p>
  
  <p>Thanks.</p>