【发布时间】:2011-11-09 14:25:12
【问题描述】:
我正在使用 google guice 和 sitebricks 构建一个管理仪表板。您能告诉我如何在 html 页面中包含其他 html 文件吗?我正在寻找一个类似于 php 的 include("header.html") 函数的函数。我看到 sitebricks 有一个 @embed 注释,但找不到太多帮助
提前致谢
【问题讨论】:
标签: java html embed guice sitebricks
我正在使用 google guice 和 sitebricks 构建一个管理仪表板。您能告诉我如何在 html 页面中包含其他 html 文件吗?我正在寻找一个类似于 php 的 include("header.html") 函数的函数。我看到 sitebricks 有一个 @embed 注释,但找不到太多帮助
提前致谢
【问题讨论】:
标签: java html embed guice sitebricks
你有不同的可能性。
使用嵌入
@Embed 注解允许您声明可以嵌入到其他页面的页面片段。
您可以在此处找到完整示例:http://code.google.com/p/google-sitebricks/wiki/EmbeddingBricks
使用装饰
另一种方法是使用页眉和页脚对通用页面进行贴花,并在页面的容器 div 上使用 @Decorated 注释。
然后你必须将所有页面声明为@Decorated 并扩展通用页面。
请在 sitebricks google 组中找到更多文档:https://groups.google.com/forum/#!searchin/google-sitebricks/decorated/google-sitebricks/CUOJM-CP9hM/ENe930RAuZwJ
【讨论】:
请查看 site-bricks 网站上的示例,如果它们有帮助,请告诉我们。 http://code.google.com/p/google-sitebricks/source/browse/trunk/acceptance-test/src/main/java/com/google/sitebricks/example/?r=146
【讨论】: