MAP | PageMixer Documents > Tutorial > Mixing with Struts > Configure Servlet | << | >> |
This section explains how to configure Servlet(using PageMixer) corresponded to JSP file(using Struts TagLib).
In this tutorial, abbreviated class names are used. Complete names are shown below.
PageServlet
againHow to use/configure PageServlet
and classes derived from it
is explained in "Mixing with Servlet".
PageMixer also provides
classes derived from PageServlet
to use
MonoPage
, LocalePage
,
DefaultPage
and I18NDefaultPage
for using in Struts environment.
They are named as
MonoPageServlet
, LocalePageServlet
,
DefaultPageServlet
and I18NDefaultPageServlet
, too,
but are placed in
jp.ne.dti.lares.foozy.pagemixer.struts
package.
web.xml
Configuration example of the Servlet instead of mainMenu.jsp
is shown below.
This example uses LocalePageServlet
for locale sensitive
response renderring,
even though you can choose MonoPageServlet
to render response locale in-sensitively.
<servlet> <servlet-name> mainMenu.page </servlet-name> <servlet-class> jp.ne.dti.lares.foozy.pagemixer.struts.LocalePageServlet </servlet-class> <init-param> <param-name> forward.condition.0 </param-name> <param-value> pagemixer.servlet.NotLoginCondition </param-value> </init-param> <init-param> <param-name> filter.factory.0 </param-name> <param-value> pagemixer.filter.UserFilter$Factory </param-value> </init-param> <init-param> <param-name> page.location </param-name> <param-value> page.mainMenu </param-value> </init-param> </servlet> : <servlet-mapping> <servlet-name> mainMenu.page </servlet-name> <url-pattern> /mainMenu.page </url-pattern> </servlet-mapping>
"NotLoginCondition
" forwards control to "login" page,
when /mainMenu.page
is accessed without authentication.
But where should this forward control? where is "login" action?
In PageMixer/Struts co-operation demonstration,
"path.logon
" context-param
is used to
tell the location of "login" action
to all NotLoginCondition
s
in demonstration of co-operation with Struts,
even though you can embed location of "login" page in
NotLoginCondition
code directly.
<context-param> <param-name> path.logon </param-name> <param-value> /logon.page </param-value> </context-param>
This allows you re-configure web application without compilation.
Please see "Mixing with Servlet"
for detail about the other init-param
s.
MAP | PageMixer Documents > Tutorial > Mixing with Struts > Create Servlet | << | >> |