PageMixer demonstration with Servlet

pagemixer.servlet
Class CustomLocaleFactory

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.pagemixer.servlet.LocaleFactory
        |
        +--pagemixer.servlet.CustomLocaleFactory
All Implemented Interfaces:
LocaleConstants, LocaleKeys, ServletConstants, ServletKeys

public class CustomLocaleFactory
extends jp.ne.dti.lares.foozy.pagemixer.servlet.LocaleFactory
implements LocaleKeys, ServletKeys

Custom implementation of "LocaleFactory".


Fields inherited from interface common.LocaleKeys
KEY_LOCALE_ENTRY, KEY_LOCALE_ENTRY_PROVIDER, KEY_PARAM_LOCALE, KEY_SESSION_LOCALE
 
Fields inherited from interface common.LocaleConstants
CLASS_LOCALE, CLASS_LOCALE_ENTRY, PARAM_LOCALE, REQUEST_LOCALE_ENTRY, REQUEST_LOCALE_ENTRY_PROVIDER, SESSION_LOCALE
 
Fields inherited from interface common.ServletKeys
KEY_BASE_HREF
 
Fields inherited from interface common.ServletConstants
INIT_AUTH_PASSWORD, INIT_AUTH_USERNAME, INIT_PAGE_AUTH, INIT_PAGE_SHOP_BASKET, INIT_PAGE_TOP, REQUEST_BASE_HREF
 
Constructor Summary
CustomLocaleFactory()
          Constructor.
 
Method Summary
 java.util.Locale create(jp.ne.dti.lares.foozy.pagemixer.mixer.ConsumerContext context)
          Create Locale.
 
Methods inherited from class jp.ne.dti.lares.foozy.pagemixer.servlet.LocaleFactory
cleanup, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomLocaleFactory

public CustomLocaleFactory()
Constructor.
Method Detail

create

public java.util.Locale create(jp.ne.dti.lares.foozy.pagemixer.mixer.ConsumerContext context)
Create Locale.

This implementation examines by steps shown belo:

  1. try to get "String" by KEY_PARAM_LOCALE from context
  2. try to get "Locale" by KEY_SESSION_LOCALE from context
  3. create "Locale" from KEY_PARAM_LOCALE value if not null, and
  4. store it by KEY_SESSION_LOCALE into context
  5. return default "Locale" by Locale.getDefault(), if both "String" and "Locale" are null
  6. return "Locale" identified by KEY_SESSION_LOCALE now
Overrides:
create in class jp.ne.dti.lares.foozy.pagemixer.servlet.LocaleFactory
Parameters:
context - of request
Returns:
locale of response renderring

PageMixer demonstration with Servlet