Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Replace</p> <pre><code>@FacesConverter(value = "categoryConverter") </code></pre> <p>by</p> <pre><code>@Named </code></pre> <p>and use</p> <pre><code>&lt;h:inputSomething converter="#{categoryConverter}" /&gt; </code></pre> <p>or</p> <pre><code>&lt;f:converter binding="#{categoryConverter}" /&gt; </code></pre> <p>instead of</p> <pre><code>&lt;h:inputSomething converter="categoryConverter" /&gt; </code></pre> <p>or</p> <pre><code>&lt;f:converter converterId="categoryConverter" /&gt; </code></pre> <p>By the way, similar problem exist for <code>@EJB</code> inside a <code>@FacesConverter</code>. It however offers a way to be grabbed by JNDI manually. See also <a href="http://balusc.blogspot.com/2011/09/communication-in-jsf-20.html#GettingAnEJBInFacesConverterAndFacesValidator" rel="noreferrer">Communication in JSF 2.0 - Getting an EJB in @FacesConverter and @FacesValidator</a>. This way you can use a <code>@FacesConverter(forClass=Category.class)</code> without manually defining it everytime. Unfortunately I can't tell from top of head how to realize that for CDI beans.</p> <hr> <p><strong>Update</strong>: if you happen to use JSF utility library <a href="http://omnifaces.org" rel="noreferrer">OmniFaces</a>, since version 1.6 is adds transparent support for using <code>@Inject</code> and <code>@EJB</code> in a <code>@FacesConverter</code> class without any additional configuration or annotations. See also <a href="http://showcase.omnifaces.org/cdi/FacesConverter" rel="noreferrer">the CDI <code>@FacesConverter</code> showcase example</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload