public class MyLinefeedConverter implements javax.faces.convert.Converter
{
public MyLinefeedConverter() {
}
public Object getAsObject(FacesContext context, UIComponent component, String value) {
return value;
}
public String getAsString(FacesContext context, UIComponent component, Object value) {
if (value==null) return "";
if (value instanceof String) return ((String)value).replace("\n", "");
return value.toString();
}
}
没有评论:
发表评论