title: Custom converter in JSF 2 with arguments
body: <p>I'm trying to implement a custom truncate converter, which truncates a string at a given index and adds a continuation symbol. The converter works fine, only when i hard code the parameters, as they are not being passed to the backend. What am I doing wrong?</p>
  
  <p>The parameters are properties of the converter class:</p>
  
  <pre><code>@FacesConverter(value = TruncateConverter.CONVERTER_ID)
  public class TruncateConverter implements Converter, StateHolder
  {
      public static final String CONVERTER_ID = "bla.blablabla.Truncate";
  
      private int truncateIndex;
      private String contSymbol;
  </code></pre>
  
  <p>Here is how i'm using the converter (or trying to):</p>
  
  <pre><code>&lt;h:outputText id="news-text-left" value="#{newsListBean.newsList_teaser.text}"&gt;
      &lt;f:converter converterId="bla.blablabla.Truncate" truncateIndex="150" contSymbol="..." /&gt;
  &lt;/h:outputText&gt;
  </code></pre>
  
  <p>I googled around for quite a bit and wasn't able to find a single example of a JSF2 converter with parameters... Thank you guys for your help, really appreciate it!</p>