Monday, 26 August 2013

JSF EL Resolver h:outputText value format

JSF EL Resolver h:outputText value format

following situation ... we have an own class, let's say MyType and we have
a MyTypeConverter (=FacesConverter).
MyType { String s; getS();}
@FacesConverter(forClass=MyType.class)
MyTypeConverter {
public String getAsString() { return ((MyType)o).getS().toUpperCase();}
}
MyBean {
getMyType() { return new MyType("hallo");}
}
<h:outputText value="#{myBean.myType}"/>
works fine
HALLO
Now:
<h:outputText value="(#{myBean.myType})"/>
Expectation:
(HALLO)
Result:
(org.playground.model.MyType@cb4a479)
Is there any EL Resolver, which can handle this?
We're running on a JBoss AS 7.1.1.Final.
Cheers and thx for any advice.

No comments:

Post a Comment