Class AgentDecoratorMapper
- All Implemented Interfaces:
DecoratorMapper
This can be useful for supplying different versions of the same content for different browsers (e.g. vanilla HTML for Lynx, complex tables and frames for Netscape, extra stuff for IE5, etc).
This can also be used to enhance search-engine ratings by using a 'bait and switch' system - this involves showing a search-engine friendly of the content to spiders only.
When AgentDecoratorMapper 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 user-agent is ie,
the path /blah-ie.jsp shall be used.
The agent mappings are configured by passing properties with match. as a prefix.
For example: 'match.MSIE'=ie , 'match.Lynx'=plain .
- See Also:
-
Field Summary
Fields inherited from class com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
config, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDecorator(jakarta.servlet.http.HttpServletRequest request, Page page) Delegate to parent.voidinit(Config config, Properties properties, DecoratorMapper parent) Set parent.Methods inherited from class com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper
getNamedDecorator
-
Constructor Details
-
AgentDecoratorMapper
public AgentDecoratorMapper()
-
-
Method Details
-
init
public void init(Config config, Properties properties, DecoratorMapper parent) throws InstantiationException Description copied from class:AbstractDecoratorMapperSet parent.- Specified by:
initin interfaceDecoratorMapper- Overrides:
initin classAbstractDecoratorMapper- Parameters:
config- Config supplied by Servlet or Filter.properties- Any initialization properties (specific to implementation).- Throws:
InstantiationException- should be thrown if the implementation cannot be initialized properly.
-
getDecorator
Description copied from class:AbstractDecoratorMapperDelegate to parent.- Specified by:
getDecoratorin interfaceDecoratorMapper- Overrides:
getDecoratorin classAbstractDecoratorMapper
-