Converter for java.lang.String

I've built a converter for the class java.lang.String as follows:

package org.wildjava.gecko.jsf.util.converter;

import javax.faces.component.UIComponent;

import javax.faces.context.FacesContext;

import javax.faces.convert.ConverterException;

/**

* @author Diego Trombetta

* @since 1.0.0

*/

publicclass StringConverterimplements javax.faces.convert.Converter{

publicstaticfinal String CONVERTER_ID ="org.wildjava.gecko.String";

/**

* @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext,

*javax.faces.component.UIComponent, java.lang.String)

*/

public Object getAsObject(FacesContext context, UIComponent component,

String value){

try{

if (context ==null || component ==null)

thrownew NullPointerException();

if (value ==null)

returnnull;

value = value.trim();

if (value.length() < 1)

returnnull;

return value;

}catch (Exception exception){

thrownew ConverterException(exception);

}

}

/**

* @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext,

*javax.faces.component.UIComponent, java.lang.Object)

*/

public String getAsString(FacesContext context, UIComponent component,

Object obj){

try{

if (context ==null || component ==null)

thrownew NullPointerException();

if (obj ==null)

return"";

return obj.toString().trim();

}catch (Exception exception){

thrownew ConverterException(exception);

}

}

}

and I've written in my facesconfig.xml the following configuration code:

<converter>

<converter-for-class>java.lang.String</converter-for-class>

<converter-class>

org.wildjava.gecko.jsf.util.converter.StringConverter

</converter-class>

</converter>

but the converter is never invoked.

Am I missing something?

I've done the same stuff with other classes and everything worked fine!

Is the java.lang.String class different for some reasons?

[4102 byte] By [mbm63a] at [2007-10-3 6:41:55]
# 1
I guess this is not working because the component value itself is a String already. For the same reason this will not work for java.lang.Object. Simply there's nothing to convert. You need a validator.
BalusCa at 2007-7-15 1:31:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
This is not a validation issue!I want to trim all the strings...IMHO it's a convertion issue...
mbm63a at 2007-7-15 1:31:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...