MAP | PageMixer Documents > Tutorial > Mixing with Servlet > Overview of PageServlet | << | >> |
This section explains overview of PageServlet
provided by PageMixer.
In this tutorial, abbreviated class names are used. Complete names are shown below.
Notation | Full name |
---|---|
ConsumerContext | jp.ne.dti.lares.foozy.pagemixer.mixer.ConsumerContext |
Filter | jp.ne.dti.lares.foozy.pagemixer.mixer.Filter |
PageEntry | jp.ne.dti.lares.foozy.pagemixer.page.PageEntry |
PageServlet | jp.ne.dti.lares.foozy.pagemixer.servlet.PageServlet |
Producer | jp.ne.dti.lares.foozy.pagemixer.mixer.Producer |
Renderer | jp.ne.dti.lares.foozy.pagemixer.mixer.Renderer |
Token | jp.ne.dti.lares.foozy.pagemixer.Token |
No tutorial specific class is explained in this section.
PageMixer provides
"PageServlet
" derived from HttpServlet
,
and response renderring procedure of it is shown below.
This allows you to focus only on
implementation which is specific for your application.
ConsumerContext
HttpServletRequest
Locale
of current request
PageEntry
by above path and locale
PageEntry
Filter
to process token stream of page
Producer
to produce token stream of page
from PageEntry
PageEntry
Writer
from current response,
of which encoding is from above content type
Renderer
with above Wirter
- connect
Filter
to Renderer
- provide stream of
Token
to Filter
by Producer
, and this causes response renderring
As described before,
PageServlet
has some customization points,
but is not designed as base class of "Template method" pattern.
It is implemented by "Strategy" pattern,
because it allows you to reuse(or combine) each strategies separately
and reduces number of classes derived from PageServlet
.
PageServlet
decides
what class should be used for each customization points
in the steps shown below.
When a construction parameter for a customization point is null,
PageServlet
uses the class
of which class name is specified as Servlet init-param
in deployment descriptor.
Names of init-param for each customization points
are explained in later sections.
PageServlet
uses
one specified as construction parameter,
only when it is not-null.
In other words,
the constructor of PageServlet
has parameters corresponded to
all customization points.
You can customize in this way
by defining the class derived from PageServlet
and using super()
invocation with your specific strategy object(s)
at its constructor.
This reduces the cost to desctibe deployment descriptor
when almost all pages share same configuration.
When none specifies implementation class,
PageServlet
uses base class(= default implementation)
for each customization points.
Please attention that any customization points do not have "default implementation" (= can not decide it).
Because above decision steps are applied for each customization points separately, you can configure one by (1), another by (2) and the other by (3) for example.
MAP | PageMixer Documents > Tutorial > Mixing with Servlet > Overview of PageServlet | << | >> |