This is working fine for me. Looks to me like JSF (1.2 RI) doesn't call getAsString but does call getAsObject - I guess it doesn't call the converter if the value is already a String.
The spec isn't really very clear on this but I guess it makes sense
Hmm, what I was seeing on JBoss 4.0.5, which should be MyFaces on JSF 1.1, is that my converter wasn't being called at all in either direction when I tried to override forClass=String.class.
What I've written is a quick converter to translate empty Strings into null. This makes my DB happier (as well as my equals()). Currently when I take input from a form and don't populate fields, they become empty strings. I'm trying to replace that default semantic with my Seam @Convert converter.
Works great if I specify a <f:converter> everywhere, but that's kind of a drag. On the whole I still love being able to register a JSF converter with two annotations. Thanks Seam.
PS: Perhaps this is an issue with MyFaces. As you say, the spec may not be clear. I'm looking forward to JBoss 4.2 and the 1.2 RI. (yea I know I could hack 4.0.5, but I'm not gunna :)
CVS is now on 4.2.0.CR1 so that's what I'm working off ;)
I guess MyFaces doesn't run converters in either directions for the Strings - this should really be specified by the spec - I guess for JSF 2.0.
An option (not a great one admittedly) is to create an s:validateAll style component to apply your converter to it's children to get around this...