wicket的序列化可以通过以下代码禁止:
public class WicketWebApplication extends WebApplication { @Override public Class<? extends Page> getHomePage() { return CqlCommanderPage.class; } @Override protected void init() { super.init(); setPageManagerProvider(new NoSerializationPageManagerProvider(this)); } }
public class NoSerializationPageManagerProvider extends DefaultPageManagerProvider { public NoSerializationPageManagerProvider(Application application) { super(application); } @Override protected IPageStore newPageStore(IDataStore dataStore) { return new IPageStore() { @Override public void destroy() { } @Override public IManageablePage getPage(String sessionId, int pageId) { return null; } @Override public void removePage(String sessionId, int pageId) { } @Override public void storePage(String sessionId, IManageablePage page) { } @Override public void unbind(String sessionId) { } @Override public Serializable prepareForSerialization(String sessionId, Object page) { return null; } @Override public Object restoreAfterSerialization(Serializable serializable) { return null; } @Override public IManageablePage convertToPage(Object page) { return null; } }; } }