English 中文(简体)
如何使用蒂尔斯进行像样的模板构成?
原标题:How to do Facelets-like template composition using Tiles?

Im利用春天、共同未来党和Tillaes开展 Java网络项目。 在我们的最后一个项目中,我们使用了“面对面”的标签:composition>和<ui:define>的标签,将联合预算和特别安全局的图书馆列入模板的头盔。 我很想知道,是否有办法使用蒂尔。

这里是我试图做的面对面主模板的一个例子:

<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:sec="http://www.springframework.org/security/facelets/tags">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
        <title><ui:insert name="title">MediMercado</ui:insert></title>
        <link href="${request.contextPath}/css/layout.css" rel="stylesheet" type="text/css" />
        <ui:insert name="additional-js"></ui:insert>
    </head>
    <body>
         <ui:insert name="content">
             <ui:include src="main-content.xhtml"/>
         </ui:insert>
    </body>
</html>

网页模板:

<ui:composition template="/layout/layout.xhtml"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    <ui:define name="additional-js">
        <script src="${request.contextPath}/js/jquery.js" type="text/javascript"></script>
    </ui:define>
    <ui:define name="content">
        <h1>Just an example</h1>
    </ui:define>
</ui:composition>

因此,在这个例子中,我们的网页模板中的jquery图书馆被列入主模板的超文本标题。

我们如何利用蒂尔来做到这一点?

最佳回答

The Tiles Tutorial涵盖了这一主题。

(Hint:在蒂里,档案比在联合财产基金中更加分离)

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签