Note that there are some explanatory texts on larger screens.

plurals
  1. POConverter selectOneMenu jsf 1.2
    text
    copied!<p>I have a problem when i call my Converter in page jsp </p> <pre><code>&lt;f:view&gt; &lt;a4j:keepAlive beanName="GenericConverter" /&gt; &lt;h:selectOneMenu value="#{Bean.var}" id="cl" converter="{GenericConverter}"&gt; &lt;f:selectItems value="#{bean.list}" /&gt; &lt;/h:selectOneMenu&gt; </code></pre> <p>This list contains an object comme value and String label after i want to return an object and work with it my Bean</p> <p>Here is my converter</p> <pre><code>public class GenericConverter implements Converter, Serializable{ private static final long serialVersionUID = 1L; private Map &lt;UUID, Object&gt; temporaryStore = new HashMap &lt;UUID, Object&gt; (); public Object getAsObject(FacesContext context, UIComponent component, String value) { if (value==null || value.isEmpty()){ return null; } return temporaryStore.get(UUID.fromString(value)); } public String getAsString(FacesContext context, UIComponent component, Object value) { UUID id = UUID.randomUUID(); if (value==null) { value = null; } temporaryStore.put(id, value); return id.toString(); } } </code></pre> <p>i work with jsf 1.2 and richefaces my bean converter is a bean request i try many of solution in google or in this site but i have another problem my problem is </p> <pre><code>&gt; déc. 17, 2013 11:15:28 AM com.sun.faces.application.ApplicationImpl createConverter SEVERE: JSF1006: Cannot instantiate converter of type {GenericConverter} déc. 17, 2013 11:15:28 AM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: "Servlet.service()" pour la servlet jsp a lancé une exception java.lang.NumberFormatException: For input string: "GenericConverter" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) </code></pre>
 

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