PageMixer API - 3.1

jp.ne.dti.lares.foozy.pagemixer.servlet
Class I18NDefaultPageFactory

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.pagemixer.servlet.PageFactory
        |
        +--jp.ne.dti.lares.foozy.pagemixer.servlet.I18NDefaultPageFactory

public class I18NDefaultPageFactory
extends PageFactory

PageFactory implementation by "I18NDefaultPage".

This implementation requires servlet 'init-param's shown below:

page.contentType:
used to construct I18NDefaultPage as default value
page.encoding(optional):
used to construct I18NDefaultPage as default value

Major difference between DefaultPageFactory and this is optional suffix mapping entries. A entry consists of three 'init-param's shown below.

page.suffix.digit:
suffix of request URI
page.contentType.digit:
content type for specified suffix
page.encoding.digit(optional):
encoding for specified suffix

Part of 'digit' shown abvoe is 0 origin number (0, 1, 2, .....).

This allow your web application to map this Servlet by '*.html' and to change locale sensitive information by path suffix. For example, Japanese configuration for '*.ja.html' and English configuration for other. See configuration example shown below.

   <servlet>
     <servlet-name>DefaultPage.ISO-8859-1</servlet-name>
       <servlet-class>
         jp.ne.dti.lares.foozy.pagemixer.servlet.I18NDefaultPageServlet
       </servlet-class>

      <init-param>
        <param-name>page.contentType</param-name>
        <param-value>text/html; charset=iso-8859-1</param-value>
      </init-param>

      <init-param>
        <param-name>page.suffix.0</param-name>
        <param-value>.ja.html</param-value>
      </init-param>
      <init-param>
        <param-name>page.contentType.0</param-name>
        <param-value>text/html; charset=Windows-31J</param-value>
      </init-param>

   </servlet>
 

Since:
PageMixer 3.0

Field Summary
static java.lang.String PARAM_CONTENT_TYPE
          Name of servlet init-param to create "DefaultPage".
static java.lang.String PARAM_ENCODING
          Name of servlet init-param to create "DefaultPage".
static java.lang.String PARAM_SUFFIX
          Name of servlet init-param to create "DefaultPage".
 
Constructor Summary
I18NDefaultPageFactory()
          Constructor.
 
Method Summary
 Page setup(javax.servlet.http.HttpServlet servlet)
          Create "I18NDefaultPage".
 
Methods inherited from class jp.ne.dti.lares.foozy.pagemixer.servlet.PageFactory
cleanup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_CONTENT_TYPE

public static final java.lang.String PARAM_CONTENT_TYPE
Name of servlet init-param to create "DefaultPage".

This has value "page.contentType".


PARAM_ENCODING

public static final java.lang.String PARAM_ENCODING
Name of servlet init-param to create "DefaultPage".

This has value "page.encoding".


PARAM_SUFFIX

public static final java.lang.String PARAM_SUFFIX
Name of servlet init-param to create "DefaultPage".

This has value "page.suffix".

Constructor Detail

I18NDefaultPageFactory

public I18NDefaultPageFactory()
Constructor.
Method Detail

setup

public Page setup(javax.servlet.http.HttpServlet servlet)
           throws javax.servlet.ServletException
Create "I18NDefaultPage".
Overrides:
setup in class PageFactory
Parameters:
servlet - with which this object works
Throws:
javax.servlet.ServletException - if parameters are not specified

PageMixer API - 3.1