2

我的瓷砖布局页面有三个部分,即页眉、正文和页脚。

布局是这样的,页面的标题必须在标题中定义。有什么办法可以从正文页标题到标题页?

瓷砖.xml

<definition name="mobile.base.definition" template="/WEB-INF/jsp/mobile/layout/baseLayout.jsp">
   <put-attribute name="header" value="/WEB-INF/jsp/mobile/common/header.jsp" />
   <put-attribute name="menu" value="/WEB-INF/jsp/mobile/common/menu.jsp" />
   <put-attribute name="footer" value="/WEB-INF/jsp/mobile/common/footer.jsp" />
</definition>

布局.jsp

    <%@ page contentType="text/html; charset=utf-8" language="java" %>

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    </head>

    <body>
        <div id="wrap">
            <header id="header">
                <tiles:insertAttribute name="header"  />
            </header>

            <div id="mainPage">
                <div class="container">
                    <div class="row-fluid">
                        <div class="span12">
                            <tiles:insertAttribute name="body" />
                        </div>      
                    </div>
                </div>
            </div>
        </div>
        <footer id="footer">
            <tiles:insertAttribute name="footer"  />
        </footer>

    </body>
</html>

头文件.jsp

    <header id="header">
<div class="container-fluid">
 <div class="row-fluid">
    <aside class="span1">
        <div class="btn-group menu-highlight">
            <button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
                <span>+</span>
            </button> 
           <div class="dropdown-menu">
            <h1><img src="img/logo-text.jpg" width="106" height="23" alt=" " /> <i class="icon-remove icon-white"></i></h1>
            <ul class="">
            <li><a href="#" class="active"><span>Home</span> <b><img src="img/icon-home.png" width="19" height="17" alt=" " /></b></a></li>
                <li><a href="#"><span>Account</span> <b><i class="icon-star"></i></b></a></li>
                <li><a href="#"><span>Contact</span> <b><i class="icon-comment"></i></b></a></li>                                
                <li><a href="#"><span>Calender</span> <b><i class="icon-calendar"></i></b></a></li>                                                
            </ul>
           </div>

        </div>
    </aside>
    <section class="span11 head-right-panel">
        <header>
         <hgroup class="span8"><h1 class="ellipsis"> Page Title</h1></hgroup>
        <span class="logo">
            <img src="img/logo.jpg" width="118" height="41" alt=" " />  
        </span>    
        </header>
    </section>
  </div>  
</div>
</header>

如果您看到 header.jsp 有页面标题。理想情况下,我们需要一个占位符,它应该被每个 body.jsp 中定义的页面标题替换

4

0 回答 0