-
If your application saves state on the client, your custom converter must implement the
Serializable
interface or theStateHolder
interface, and thesaveState(FacesContext)
andrestoreState(FacesContext, Object)
methods of theStateHolder
interface. For more information, see the Javadoc for theStateHolder
interface ofjavax.faces.component
package.
ADF web 应用程序如果在客户端JSF 页面实行数据的保存或者操作,应当要实现Sarializable 类,否则会报序列化问题。、
package com.szs.trian.converter;
import java.io.Serializable;
import java.util.Map;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
public class ConverterDemo implements Converter, Serializable {
public ConverterDemo() {
super();
}
@Override
public Object getAsObject(FacesContext facesContext, UIComponent uIComponent, String string) {
// TODO Implement this method
return null;
}
@Override
public String getAsString(FacesContext facesContext, UIComponent uIComponent, Object object) {
// TODO Implement this method
return null;
}
}
import java.io.Serializable;
import java.util.Map;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
public class ConverterDemo implements Converter, Serializable {
public ConverterDemo() {
super();
}
@Override
public Object getAsObject(FacesContext facesContext, UIComponent uIComponent, String string) {
// TODO Implement this method
return null;
}
@Override
public String getAsString(FacesContext facesContext, UIComponent uIComponent, Object object) {
// TODO Implement this method
return null;
}
}