Home of: [Atelier "FUJIGURUMA"] >> [PageMixer hosted by SourceForge.net]

SEE "For Readers of English Version",
or Japanese version of this page

Migration guide

This document explains how to migrate from PageMixer earlier version to later version.

Migration from 3.0 to later

Adjust for modified fields

You should re-compile your classes, which depends on class fileds shown below:

moved fields:
Since PageMixer 3.1 or later, BASE_HREF_KEY and CONTEXT_PATH_KEY are defined not in StrutsConsumerContext, but in ServletConsumerContext .
type changed fields:
Since PageMixer 3.1 or later, "static" member fields for "key object" are defined not as "Object", but as concrete class.

Without re-compilation, NoSuchFieldError may be thrown at runtime.

Migration from 2.x to 3.x

Migration around locale sensitive renderring

Classes for locale sensitive renderring are re-designed systematically, and it is not so easy to explain by short document.

Please see "Render locale sensitively" for detail about current specification of locale sensitive renderring.

Migration around Servlet environment

Classes for Servlet environment are re-designed systematically, and it is not so easy to explain by short document.

Please see "Mixing with Servlet" for detail about current specification of PageMixer Servlet environment support.

Migration around Struts co-operation

Except of renaming ErrorsFilter, almost all part of migration from 2.x to 3.x around Struts co-operation is from one around Servlet environment.

You must rename ErrorsFilter to ErrorsTrimFilter, because it is renamed to introduce new class ErrorsInsetFilter.

Migration from 1.x to 2.x

Migration around *Watcher

This section explains about change of *Watcher interfaces (TokenWatcher and SequenceWathcer).

Migration for *Watcher developer

Since 2.0, *Watcher interface definitions have "clear()" method to clear own processing context information, because of increasing re-usability of Filter including *Watcher.

You, *Watcher developer, should define "clear()" method, even if your class does not have processing context information.

Migration for Filter developer

As described former, *Watcher implementation has "clear()" method. So, you, Filter developer, should invoke it at the end of token stream (= in flush(ConsumerContext) method), if your custom class uses *Watcher.

You do not have to do anything, if your custom class:

Migration around LocalePage

This section explains about change of LocalePage class.

Migration for LocalePage user

Since 2.0, LocalePage.ByParser (or LocalePage.ByPersistentProducer) is replaced by LocatorLocalePage.ByPageParser (or LocatorLocalePage.ByPersistentProducer).

To invoke constructor of above classes, You should choose one of Locator implementations shown below, or implement Locator by yourself.

Locator.ByClass
read data in by Class#getResourceAsStream.
Locator.ByServletContext
read data in by ServletContext#getResourceAsStream or Class#getResourceAsStream.
Locator.OnLocalFS
read data in by FileInputStream. This allows you to re-read data in when it is modified.
Locator.OnWebApp
read data under web application context in by FileInputStream. This allows you to re-read data in when it is modified.

Migration for LocalePage developer

LocalePage between version "1.x" and "2.0" is too different to explain shortly.

So, please read API documentation for detail.

You may think it becomes complex at first, but I think it makes custom implementation easy.

Migration around Struts co-operation

There are tow action items to migrate around Struts co-operation shown below.

  1. change base class of presentation Servlet from "MixerServlet" to "StrutsPage"
  2. change definition of "shouldForward" method

Since version 2.0, MixerServlet is replaced by StrutsPage, which is derived from PageServlet, and it is not included in distribution.

Please change base class of your "presentation" Servlet from MixerServlet to StrutsPage.

And then, you should adjust definition of method "shouldForward".

In version 1.x, this method has one paramter(ConsumerContext), and is expected to return boolean value.

But now, this method as two parameters(ConsumerContext and String as default forward destination), and is expected to return String as forward destination.

So, what you should do is to return given forward destination (if you want to forward control) or null(if you do not).