title: How to register a (Component)SystemEventListener for all UIInputs
body: <p>I am trying to have a custom <code>SystemEventListener</code> that registers for all instances of type <code>UIInput</code> and reacts to their <code>postValidate</code>-Events. Based on an example I found on the web I managed to get one running for <code>HtmlInputText</code> by registering it in the <code>faces-config.xml</code> as follows:</p>
  
  <pre><code>&lt;system-event-listener&gt;
     &lt;source-class&gt;javax.faces.component.html.HtmlInputText&lt;/source-class&gt;
     &lt;system-event-class&gt;javax.faces.event.PostValidateEvent&lt;/system-event-class&gt;
     &lt;system-event-listener-class&gt;com.ourcompany.ourproduct.validators.inputPostValidationListener&lt;/system-event-listener-class&gt;
   &lt;/system-event-listener&gt;
  </code></pre>
  
  <p>I then tried to 1) broaden this to work for UIInputs in general and to 2) use the <code>@ListenerFor</code>annotation, but I just can't seem to get either of it to work.</p>
  
  <p>for 1) I couldn't really find any examples or documentation, so i just tried around by a) defining multiple source-class-tags or by b) using <code>javax.faces.component.UIInput</code> as source-class. Neither worked.</p>
  
  <p>for 2) I tried</p>
  
  <pre><code>@ListenerFor(systemEventClass = PostValidateEvent.class, sourceClass = UIInput.class)
  </code></pre>
  
  <p>which worked neither for UIInput nor for html.HtmlInputText.</p>
  
  <p>Now, when I duplicate the same XML-configuration for all the other types of HTML-Inputs, this does the trick, but it just clutters up the xml and altogether seems quite annoying to me.</p>
  
  <p>So the question is: Am I generally doing something wrong with the @ListenerFor annotation? Is there a restriction on which source-classes are possible, i.e. why can't I use the more generic UIInput? Is there a more efficient way to register the listener for all those different inputs than repeating the XML? And finally: I'd rather like to implement <code>ComponentSystemEventListener</code>. Assuming that the above problem was resolved, I'd just change the <code>implements</code>-Statement and implement the abstract <code>processEvent</code> accordingly, right? Would that work just the same or is the registration/xml-config different in this case (e.g. maybe <code>&lt;component-system-event-listener&gt;</code> instead of just <code>&lt;system-event-listener&gt;</code>?</p>
  
  <p>(and as an after-note: is it just me or is it kind of hard to find any non-trivial examples for this kind of stuff on the web?) </p>