title: Converter in jsf not work
body: <pre><code>&lt;p:selectOneMenu id="tag1" value="#{attachmentManagement.tag1}" converter="#{stringFilterConverter}"&gt;
      &lt;f:selectItems value="#{attachmentManagement.tag1List}" var="tag1" itemLabel="#{not empty tag1.value ? tag1.value : '无'}"/&gt;
  &lt;/p:selectOneMenu&gt;
  
  &lt;p:commandButton value="button" actionListener="#{attachmentManagement.someFuction()}"/&gt;
  </code></pre>
  
  <p>When I click the button, this exception was throwed:</p>
  
  <pre><code>javax.faces.component.UpdateModelException: java.lang.IllegalArgumentException: Cannot convert com.bolan.fzsystem.appserver.view.model.StringFilter@17dbb2e of type class java.lang.String to class com.bolan.fzsystem.appserver.view.model.StringFilter
  ....
  Caused by: java.lang.IllegalArgumentException: Cannot convert com.bolan.fzsystem.appserver.view.model.StringFilter@17dbb2e of type class java.lang.String to class com.bolan.fzsystem.appserver.view.model.StringFilter
  ....
  </code></pre>
  
  <p>stringFilterConverter and someFunction is not called at all.
  Since I have set a converter, why jsf not use it and use toString() to update the value.</p>
  
  <p>My converter implementation is a CDI bean. I found the solution. I change the scope of converter from default to application scope. And now converter works. But why?</p>
  
  <p>This is my converter implementation:</p>
  
  <pre><code>@Named
  @ApplicationScoped //change scope from default to this
  public class StringFilterConverter implements Converter, Serializable {
     private static final long serialVersionUID = -6691961589607931061L;
  
      @Override
      public Object getAsObject(FacesContext context, UIComponent component, String value) {
          if (value == null || value.isEmpty()) {
              return ValueFilter.UNDEFINE;
          }
          return JSON.parseObject(value, new TypeReference&lt;String&gt;() {});
      }
  
      @Override
      public String getAsString(FacesContext context, UIComponent component, Object value) {
          ValueFilter&lt;String&gt; filter = (ValueFilter&lt;String&gt;) value;
          return JSON.toJSONString(filter);
      }
  }
  </code></pre>