到 Google 资讯主页   
EasyJF首页   资料   源码   软件    论坛   网站    
   使用帮助    
    该信息为本站MyRSS系统缓存内容,部分图片及附件有可能无法正常使用.easyjf.comBlogJava无关,不对该信息负责.通过http://kb.csdn.net/keyword/java//../../java/Articles/200604/581dfbd7-86db-4006-95c0-e6042ff0535f.html访问该信息的原始内容.
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   
how to deal with the Frame when using sitemesh
作者:junhong 来源:BlogJava  发布时间:2006-04-13 00:00:00.0

  1. install the sitemesh described in the above article.
  2. To be able to specify which mappers will be applied to a request, create the file [web-app]/WEB-INF/sitemesh.xml that contains the following:

    <sitemesh>
        <property name="decorators-file" value="/WEB-INF/decorators.xml" />
        <excludes file="${decorators-file}" />
    
        <page-parsers>
            <parser content-type="text/html"
                class="com.opensymphony.module.sitemesh.parser.FastPageParser" />
            <parser content-type="text/html;charset=ISO-8859-1"
                class="com.opensymphony.module.sitemesh.parser.FastPageParser" />
        </page-parsers>
    
        <decorator-mappers>
            <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
                <param name="config" value="${decorators-file}" />
            </mapper>
        </decorator-mappers>
    </sitemesh>
    

    in this example, the only mapper that will be applied is the ConfigDecoratorMapper, and that will only be applied to responses of type text/html or text/html;charset=ISO-8859-1. Responses of any other content type (eg image/gif) will be ignored by Sitemesh. Additionally, any files that match a pattern specified in the excludes file (in this case '/WEB-INF/decorators.xml') will not be touched by Sitemesh.

  3. The excludes file points to an XML file that contains an <excludes /> block similar to the following: add the following code in your decorators.xml

    <decorators defaultdir="/decorators">
    ?<excludes>
    ??<pattern>/plainPage.jsp</pattern>
    ??<pattern>/ewebeditor/*.*</pattern>
    ?</excludes>
    ?<decorator name="main" page="main.jsp">
    ??<pattern>/*</pattern>
    ?</decorator>
    </decorators>


junhong 2006-04-13 23:46

 
相关文章
 
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   


EasyJF.com 2006 隐私政策 使用EasyJF前必读