JSP中的模板。添加<;脚本>;及<;链接>;从不同模板客户端到<;头>;模板的标记

JSP中的模板。添加<;脚本>;及<;链接>;从不同模板客户端到<;头>;模板的标记,jsp,jstl,jsp-tags,Jsp,Jstl,Jsp Tags,我将使用JSP中的模板,如下所示。下面给出的标记文件存储在/WEB-INF/tags下 genericTag.tag(它是一个基本模板): 然后,可以从模板客户机(例如 <ui:define name="title">New Page Title</ui:define> 新页面标题 ? <%@tag description="put the tag description here" pageEncoding="UTF-8"%> <%@taglib

我将使用JSP中的模板,如下所示。下面给出的标记文件存储在
/WEB-INF/tags

genericTag.tag(它是一个基本模板):

然后,可以从模板客户机(例如

<ui:define name="title">New Page Title</ui:define>
新页面标题
?

<%@tag description="put the tag description here" pageEncoding="UTF-8"%>

<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@attribute name="pageTitle" required="true"%>

<t:genericTag>
    <jsp:attribute name="header">
        <script type="text/javascript" src="resources/default/js/template-scriptsss.js">
        </script>
    </jsp:attribute>

    <jsp:attribute name="title">${pageTitle}</jsp:attribute>

    <jsp:attribute name="north">
        <jsp:include page="/WEB-INF/admin_template_files/North.jsp" flush="false"/>
    </jsp:attribute>

    <jsp:attribute name="west">
        <jsp:include page="/WEB-INF/admin_template_files/West.jsp" flush="false"/>

    </jsp:attribute>

    <jsp:attribute name="south">
        <jsp:include page="/WEB-INF/admin_template_files/South.jsp" flush="false"/>
    </jsp:attribute>

    <jsp:body>
        <jsp:doBody/>
    </jsp:body>
</t:genericTag>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>

<t:template pageTitle="Test">
  <p>
        Contents of the tag body go here.
  </p>
</t:template>
<title><ui:insert name="title">Default Title</ui:insert></title>
<ui:define name="title">New Page Title</ui:define>