Я установил OmniFaces 1,6, и я создал классы аннотированные @FacesConverter(forClass=MyClass.class)
ВНИМАНИЕ: @FacesConverter используется как значение и forClass, только значение будет применяться
при развертывании проекта в GlassFish я несколько wornigs:
INFO: Initialisation de Mojarra 2.2.2 (20130809-1625 https://svn.java.net/svn/mojarra~svn/tags/[email protected]) pour le contexte «/ErpCCFWEB»
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
WARNING: @FacesConverter is using both value and forClass, only value will be applied.
INFO: Running on PrimeFaces 4.0.RC1
у меня есть 3 аннотированных классов, один из них заключается в следующем:
@FacesConverter(forClass = Commune.class)
public class CommuneConverter implements Converter {
private static final Logger LOG = Logger.getLogger(CommuneConverter.class.getName());
@EJB
private ReferentielDaoLocal myService;
@Override
public Object getAsObject(FacesContext context, UIComponent component, String value) {
if (value == null) {
return null;
} else {
try {
// ReferentielDaoLocal myService = (ReferentielDaoLocal) new InitialContext().lookup("java:global/ErpCCF/ErpCCF-ejb/ReferentielDaoImpl");
return myService.findCommuneByCode(value);
} catch (Exception ex) {
LOG.log(Level.SEVERE, "Converter Commune Error", ex.getMessage());
return null;
}
}
}
@Override
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value == null) {
return null;
} else {
return String.valueOf(((Commune) value).getIdCommune());
}
}
}
но я использую Mojarra 2.2.2 –
Ошибка должна быть связана с версиями 2.1.25 и 2.2.2 (они следуют одной и той же дорожной карте). Просто обновите его! –