Usage of the Configdecoratormapper mapper for Sitemesh2-sitemesh.xml

Source: Internet
Author: User

Following the previous example project Http://www.cnblogs.com/EasonJim/p/7083165.html, using the Configdecoratormapper Mapper, the page under the specified directory is the same as the template page.

On the use, just set two places, no configuration on the basic page.

1, Decorators.xml

<?XML version= "1.0" encoding= "UTF-8"?><DecoratorsDefaultDir= "/decorators">    <Decoratorname= "Basic-theme"page= "basic-theme.jsp">        <pattern>/data/*</pattern>    </Decorator></Decorators>

2, Sitemesh.xml

<Sitemesh>    <property name= "Decorators-file" value= "/web-inf/decorators.xml"/> <excludes file= "${decorators-file} "/>    <page-parsers>        <ParserContent-type= "text/html"class= "Com.opensymphony.module.sitemesh.parser.HTMLPageParser" />    </page-parsers>    <decorator-mappers>        <Mapperclass= "Com.opensymphony.module.sitemesh.mapper.PageDecoratorMapper">            <paramname= "Property.1"value= "Meta.decorator" />            <paramname= "property.2"value= "Decorator" />        </Mapper>        <Mapperclass= "Com.opensymphony.module.sitemesh.mapper.FrameSetDecoratorMapper"/>        <Mapperclass= "Com.opensymphony.module.sitemesh.mapper.PrintableDecoratorMapper">            <paramname= "Decorator"value= "Printable" />            <paramname= "Parameter.name"value= "Printable" />            <paramname= "Parameter.value"value= "true" />        </Mapper>        <Mapperclass= "Com.opensymphony.module.sitemesh.mapper.FileDecoratorMapper"/>        <mapper class= "Com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper" > <param name= "config "Value=" ${decorators-file} "/> </mapper>    </decorator-mappers></Sitemesh>

Reference:

Https://web.archive.org/web/20071008163555fw_/http://www.opensymphony.com/sitemesh/api/com/opensymphony/module /sitemesh/mapper/configdecoratormapper.html

Usage of the Configdecoratormapper mapper for Sitemesh2-sitemesh.xml

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.