Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: test serialization settings

...

In Wicket 1.2 you could override method newMarkupResourceStream from MarkupContainer to provide a custom resource stream for loading the component's markup. The new way of letting markup containers provide custom markup is to let them implement interface IMarkupResourceStreamProvider and implement it's method getMarkupResourceStream. Additionally, a new feature is that you can provide your own markup cache key, which is used in the MarkupCache class. The only real use case for that is to let a markup container return a cache key that is null, in which case the resource won't be cached, causing Wicket to get call getMarkupResourceStream everytime the component's markup is requested. A use case for that is when you have dynamic markup (e.g. from a database) that is request/ session dependent. To achieve this, let your markup container also implement IMarkupCacheKeyProvider and let method getCacheKey return null.

Test serialization setting removed

The setting IDebugSettings#SerializeSessionAttributes is removed. Instead you can use the SecondLevelCacheSessionStore, which serialized (old) pages to a second level cache (user.tmp by default). SecondLevelCacheSessionStore will (probably) be the default configured session store, but you can configure it yourself by doing in your application:

Code Block
java
java

/**
 * @see wicket.Application#newSessionStore()
 */
protected ISessionStore newSessionStore() {
  return new SecondLevelCacheSessionStore(new FilePageStore());
}

Also, you can use

Code Block
java
java

wicket.util.Objects#checkSerializable(Object)

to check for non-serializable objects yourself. You could do this for instance in a custom session store implementation.