• iframe替代方案


    自己写一个pagelet框架。封装成JSP的Taglib。

    <tms:view header="common-header" footer="common-footer">
    
            <tms:pagelet
                html="/pagelet1/template.html" 
                js="/pagelet1/js/p1.js,/pagelet1/js/p2.js" 
                css="/pagelet1/p1/css/css.js" >
            </tms:pagelet>
    
            <tms:pagelet
                html="/pagelet2/template.html" 
                js="/pagelet2/js/p1.js,/pagelet2/js/p2.js" 
                css="/pagelet2/p1/css/css.js" >
            </tms:pagelet>
    
             <!--jsp页面-->
            <tms:pagelet
                jsp="/pagelet3/template.jsp" 
                controller="com.luan.cc.Pagelet3Controller" 
                js="/pagelet3/js/p1.js,/pagelet3/js/p2.js" 
                css="/pagelet3/p1/css/css.js" >
            </tms:pagelet>
    
    </tms:view>

    最终会生成这样的HTML代码:

    <html id='html-loginPageView'>
    <head>
        <meta http-equiv='X-UA-Compatible' content='IE=EDGE'>
        <title>DEMO</title>
        <link rel="stylesheet" type="text/css" href='common/css/common_da8e974dc.min.css' />
        <link rel="stylesheet" type="text/css" href='dd/dd/dd1_0ac99c7b1f1504f.min.css' />
        <link rel="stylesheet" type="text/css" href='dd/dd/dd2_099c7b1f150614f.min.css' />
        <link rel="stylesheet" type="text/css" href='dd/dd/dd3_059b1f70ac99c7b.min.css' />
    </head>
    
    <body>
        
        <div id="tms-pagelet-1">
            <div>
                <!--pagel-->
            </div>
        </div>
    
        <div id="tms-pagelet-2">
            <div>
                ......
            </div>
        </div>
    
        <div id="tms-pagelet-3">
            <div>
                ......
            </div>
        </div>
    
        <script type='text/javascript' src='common/js/common_da8e974dc.min.js' ></script>
        <script type='text/javascript' src='dd/dd/dd1_ac99c7b1f150614f.min.js' ></script>
        <script type='text/javascript' src='dd/dd/dd2_059b17b1f150614f.min.js' ></script>
        <script type='text/javascript' src='dd/dd/dd3_ac99c7b1f150614f.min.js' ></script>
        
    </body>
  • 相关阅读:
    无法直接启动带有类库输出类型的项目
    2个页面传值方法
    vs2005 无法附加 绑定句柄无效 解决办法
    认识serializable,序列化
    jsp 连接sql 2008
    有进步,嘎嘎....
    找不到存储过程'dbo.aspnet_CheckSchemaVersion'
    BackOffice Common中实现的相关功能
    MVC中Action相关方法的建议
    mysql的数据库相关维护操作:重启、修改连接数、删除连接
  • 原文地址:https://www.cnblogs.com/lhp2012/p/5035889.html
Copyright © 2020-2023  润新知