You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
ELSupport.coerceToType lacks support for class runtime type conversion.
I tried to pass a class instance to a converter attribute but failed due to:
java.lang.IllegalArgumentException: Cannot convert java.util.Date of type class java.lang.String to class java.lang.Class
at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:428)
public class Range<T>
{
private T start;
private T end;
}
public class RangeConverter<T> implements Converter<T>
{
// required in getAsObject method
private Class<T> type;
public Range<T> getAsObject(FacesContext context, UIComponent component, final String value)
{
// create default converter for start ane end
Converter<T> startEndConverter = context.getApplication().createConverter(this.type)
}
public void setType(Class<T> type)
{
this.type = type;
}
}
Class Converter
Registration of a @FacesConverter for Class.class did not worked.
@FacesConverter(forClass = Class.class)
public class ClassConverter implements Converter<Class<?>>
ELSupport.coerceToType lacks support for class runtime type conversion.
I tried to pass a class instance to a converter attribute but failed due to:
java.lang.IllegalArgumentException: Cannot convert java.util.Date of type class java.lang.String to class java.lang.Class
at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:428)
Markup:
Converter:
Class Converter
Registration of a
@FacesConverter
forClass.class
did not worked.Example
http://showcase.omnifaces.org/converters/ToCollectionConverter Passes the type as a String and converts it internally. But this is unnecessary if coerceToType supports Class.class
The text was updated successfully, but these errors were encountered: