Save This Page
Home » sitemesh-2.3 » com.opensymphony.module » sitemesh » mapper » [javadoc | source]
com.opensymphony.module.sitemesh.mapper
public final class: LanguageDecoratorMapper [javadoc | source]
java.lang.Object
   com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
      com.opensymphony.module.sitemesh.mapper.LanguageDecoratorMapper

All Implemented Interfaces:
    DecoratorMapper

The LanguageDecoratorMapper can determine the preferred language set in the browser requesting a page, and map to a suitable Decorator (using the "Accept-Language" HTTP header).

This can be useful for supplying different versions of the same content for different languages.

When LanguageDecoratorMapper is in the chain, it will request the appropriate Decorator from its parent. It will then add an extention to the filename of the Decorator, and if that file exists it shall be used as the Decorator instead. For example, if the Decorator path is /blah.jsp and the detected preferred language is en, the path /blah-en.jsp shall be used.

The language mappings are configured by passing properties with match. as a prefix. For example: 'match.en'=engl , 'match.nl'=dutch .

Fields inherited from com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper:
parent,  config
Method from com.opensymphony.module.sitemesh.mapper.LanguageDecoratorMapper Summary:
getDecorator,   init
Methods from com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper:
getDecorator,   getNamedDecorator,   init
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.opensymphony.module.sitemesh.mapper.LanguageDecoratorMapper Detail:
 public Decorator getDecorator(HttpServletRequest request,
    Page page) 
 public  void init(Config config,
    Properties properties,
    DecoratorMapper parent) throws InstantiationException