MAP | PageMixer Documents > Migration guide |
This document explains how to migrate from PageMixer earlier version to later version.
You should re-compile your classes, which depends on class fileds shown below:
Object
",
but as concrete class.
Without re-compilation,
NoSuchFieldError
may be thrown
at runtime.
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.
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.
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
.
*Watcher
This section explains about
change of *Watcher
interfaces
(TokenWatcher
and SequenceWathcer
).
*Watcher
developerSince 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.
Filter
developerAs 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:
*EditFilter
class, and
flush(ConsumerContext)
LocalePage
This section explains about
change of LocalePage
class.
LocalePage
userSince 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
Class#getResourceAsStream
.Locator.ByServletContext
ServletContext#getResourceAsStream
or Class#getResourceAsStream
.Locator.OnLocalFS
FileInputStream
.
This allows you to re-read data in when it is modified.Locator.OnWebApp
FileInputStream
.
This allows you to re-read data in when it is modified.LocalePage
developerLocalePage
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.
There are tow action items to migrate around Struts co-operation shown below.
MixerServlet
"
to "StrutsPage
"
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).
MAP | PageMixer Documents > Migration guide |