2

我有几个 spring mvc tile 页面,我的 tiles.xml 文件是这样的:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
       "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
    <tiles-definitions>
    <definition name="base.definition"
        template="/WEB-INF/views/layout.jsp">
        <put-attribute name="title" value="" />
        <put-attribute name="header" value="/WEB-INF/views/header.jsp" />
        <put-attribute name="menu" value="/WEB-INF/views/menu.jsp" />
        <put-attribute name="body" value="" />
        <put-attribute name="footer" value="/WEB-INF/views/footer.jsp" />
     </definition>

     <definition name="home" extends="base.definition">
        <put-attribute name="title" value="page home" />
        <put-attribute name="body" value="/WEB-INF/views/home.jsp" />
    </definition>

    <definition name="product" extends="base.definition">

      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/product.jsp" /> 
     </definition>
    <definition name="note" extends="base.definition">

      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/note.jsp" /> 
    </definition>

    <definition name="tnote" extends="base.definition">

      <put-attribute name="title" value="p" />
         <put-attribute name="body" value="/WEB-INF/views/tnote.jsp" /> 
      </definition>

        <definition name="D" extends="base.definition">
       <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/D.jsp" /> 
       </definition>

         <definition name="contactUs" extends="base.definition">
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/contactUs.jsp" /> 
       </definition>

         <definition name="dsgc" extends="base.definition">
        <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/dsgc.jsp" /> 
       </definition>

      <definition name="login" template="/WEB-INF/views/admin/adminLayout.jsp">
        <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/login.jsp" /> 
      </definition>


      <definition name="adm_main" template="/WEB-INF/views/admin/adminLayout.jsp">
        <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_main.jsp" /> 
       </definition>

     <definition name="adminPage" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adminPage.jsp" /> 
    </definition>

     <definition name="adm_products" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_products.jsp" /> 
    </definition>
    <definition name="adm_products_images" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_products_images.jsp" /> 
    </definition>
    <definition name="adm_ads" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_ads.jsp" /> 
    </definition>
     <definition name="adm_menus" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_menus.jsp" /> 
    </definition>
     <definition name="adm_settings" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_settings.jsp" /> 
    </definition>
     <definition name="adm_members" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_members.jsp" /> 
    </definition>
   <definition name="adm_resellers" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_resellers.jsp" /> 
    </definition>
     <definition name="adm_news" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_news.jsp" /> 
    </definition>
    <definition name="adm_tips" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_tips.jsp" /> 
    </definition>
    <definition name="adm_gnotes" template="/WEB-INF/views/admin/adminLayout.jsp" >
      <put-attribute name="title" value="p" />
        <put-attribute name="body" value="/WEB-INF/views/admin/adm_gnotes.jsp" /> 
    </definition>
</tiles-definitions>

现在我想在另一个页面的 iframe 中调用这些页面。我的代码是这样的:

     <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org /TR/html4/loose.dtd">
     <html>
     <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" dir="rtl" >
    <title>Insert title here</title>
    <script type="text/javascript">
    var reserved_tab_content_height = 60;
    var selected_idx = 0;
    var tab_idx = 0;
    function set_tab_content_height() {
    $(".tab_content").css('height',
            $(window).height() - reserved_tab_content_height);
       }



    $(function(){

    set_tab_content_height();

    $("#menuItems td").click(function() {
        var menuItem = $(this).text();
        $("#menuItems td").removeClass("selected_item");
        $(this).addClass("selected_item");
        var id=$(this).attr("id");
        var number=id.split('-')[2];
        $("#tab_container td").hide();
        $("#tab-td-"+number).show();
        $("#tab-content-"+number).show();

    });
    $(window).resize(function() {
        set_tab_content_height();
    });


    });
    </script>
    </head>
    <body>

    <%-- <a href="<c:url value='/j_spring_security_logout'/>">Logout</a> --%>



    <div id="mainDiv" >
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tbody>
                <tr>
                    <td valign="bottom"
                        style="border: 1px solid black; padding:     5px 5px 5px 5px;">
                        <table id="menuItems" class="menu"     cellpadding="0" cellspacing="0"
                            border="0" align="right">
                            <tbody>
                            <tr id="tabs0">
                            <sec:authorize access="hasRole('ROLE_one')">
                                <td id='tab-item-1' style='border:1px solid;'>کالاها</td>
                            </sec:authorize>                                
                                <sec:authorize access="hasRole('ROLE_two')">
                                <td id='tab-item-2' style='border:1px solid;'>عکس کالاها</td>
                            </sec:authorize>                            
                            <sec:authorize access="hasRole('ROLE_three')">
                                <td id='tab-item-3' style='border:1px solid;'>تبلیغات</td>
                            </sec:authorize>

                                <sec:authorize access="hasRole('ROLE_four')">
                                <td id='tab-item-4' style='border:1px solid;'>اخبار جدید</td>
                            </sec:authorize>    

                                <sec:authorize access="hasRole('ROLE_five')">
                                <td id='tab-item-5' style='border:1px solid;'>یادداشت ها</td>
                            </sec:authorize>

                                <sec:authorize access="hasRole('ROLE_six')">
                                <td id='tab-item-6' style='border:1px solid;'>روزنوشت ها</td>
                            </sec:authorize>


                            </tr>
                            <tr id="tabs6">

                                <sec:authorize access="hasRole('ROLE_seven')">
                                <td id='tab-item-7' style='border:1px solid;'>منوها</td>
                            </sec:authorize>
                            <sec:authorize access="hasRole('ROLE_eight')">
                                <td id='tab-item-8' style='border:1px solid;'>تنظیمات</td>
                            </sec:authorize>
                            <sec:authorize access="hasRole('ROLE_nine')">
                                <td id='tab-item-9' style='border:1px solid;'>آپلود</td>
                            </sec:authorize>
                            <sec:authorize access="hasRole('ROLE_ten')">
                                <td id='tab-item-10' style='border:1px solid;'>کاربران</td>
                            </sec:authorize>
                            <sec:authorize access="hasRole('ROLE_eleven')">
                                <td id='tab-item-11' style='border:1px solid;'>نمایندگان</td>
                            </sec:authorize>
                            <sec:authorize access="hasRole('ROLE_twoelve')">
                                <td id='tab-item-12' style='border:1px solid;'>آرشیو مجلات</td>
                            </sec:authorize>
                            </tr>
                            </tbody>
                        </table>


                        <table cellpadding="0" cellspacing="0" border="0" align="left"
                            style="margin-top: 15px">
                            <tr>
                                <td style="color: blue; font-size: 8pt" id="unameTd"></td>
                                <td style="padding-right: 10px"><img
                                     style="cursor: pointer"
                                    src="resources/images/keys.png"></td>
                                <td><a href="<c:url value='/j_spring_security_logout'/>"><img  style="cursor: pointer"
                                    src="resources/images/exit.png">

                                    </a></td>
                            </tr>
                        </table>
                </td>
                </tr>
                <tr>
                    <td  style="border: 1px solid black;">
                        <table width="100%" cellpadding="0" cellspacing="0" border="0">
                            <tbody>
                                <tr id="tab_container">
                                <td id="tab-td-1" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-1" class="tab_content" frameborder="0" src="/adm_products" style="height: 296px; width: 0px; display: none;">
                                    </iframe>
                                </td>
                                <td id="tab-td-2" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-2" class="tab_content" frameborder="0" src="/adm_product_images" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-3" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-3" class="tab_content" frameborder="0" src="/adm_ads" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-4" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-4" class="tab_content" frameborder="0" src="/adm_news" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-5" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-5" class="tab_content" frameborder="0" src="/adm_tips" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                    <td id="tab-td-6" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-6" class="tab_content" frameborder="0" src="/adm_gnotes" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-7" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-7" class="tab_content" frameborder="0" src="/adm_menus" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-8" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-8" class="tab_content" frameborder="0" src="/adm_settings" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-9" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-9" class="tab_content" frameborder="0" src="/adm_uploads" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-10" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-10" class="tab_content" frameborder="0" src="/adm_members" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-11" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-11" class="tab_content" frameborder="0" src="/adm_resellers" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    </iframe>
                                </td>
                                <td id="tab-td-12" class="ui-widget-content ui-corner-bottom" style="display: none; width: 0">
                                    <iframe id="tab-content-12" class="tab_content" frameborder="0" src="/adm_archive" style="height: 296px; width: 0px; display: none;" allowtransparency="true">
                                    <p>asdasdas</p>
                                    </iframe>
                                </td>

                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>

</div>


</body>
</html>

我的目标是当我点击标签时,该标签页出现在 iframe 中。但我看不到我的 iframe,我的 iframe src 应该是什么?

4

0 回答 0