Class clazz = this.clazz != null ? this.clazz : object.getClass();
Configuration configuration = createConfiguration(object, clazz);
final ObjectWrapper wrapper = configuration.getObjectWrapper();
configuration.setObjectWrapper(new ObjectWrapper() {
public TemplateModel wrap(Object obj) throws TemplateModelException {
TemplateModel model = wrapper.wrap(obj);
if ( model instanceof SimpleHash ) {
SimpleHash hash = (SimpleHash) model;
if ( hash.get( "page" ) == null ) {
PageInfo pageInfo = (PageInfo) request.getAttributes().get( PageInfo.KEY );
if ( pageInfo != null ) {