title: JSF throw FacesMessage from regular bean method
body: <p>In JSF's custom convertors and validators you can say:</p>
  
  <pre><code>FacesMessage message = new FacesMessage(
      FacesMessage.SEVERITY_ERROR, "Invalid length!",
      "Length = 8");
  throw new ConverterException(message);
  </code></pre>
  
  <p>and ti sends the message to some h:message component determined from the convertor or validator. Is there a way to do something like that in regular bean method(and if so, how to determine the h:message component witch will render the message) or the better way is to do all the validation work in custom validators and to left business logic with no checks for the bean methods.</p>