JSF 2.0 Facelets标签之ui:include

一.先上各种对ui:include的解释说明:

1.The UI Include tag is a server-side include tag for Facelets. It simply includes the document pointed to by the "src" attribute as part of the current JSF page. The included document should use a component or composition tag to trim unnecessary markup, or it may simply contain a fragment of XHTML or XML to be included.(From JSFToolBox.com)

ui:include标签服务器端的Facelets包含标签,它把src属性指示的页面的内容简单地包含到当前页面ui:include所在位置。被包含的内容应该由ui:composition或ui:component标包围着。

 

2.The ui:include tag is the Facelets equivalent of the jsp:include tag. It provides the ability to
include/insert markup into a Facelet view or composition that is contained in a separate
XHTML file.(From JavaServer Faces 2.0:The Complete Reference)

这个更没解释一样。

 

二.ui:include用法

1.被所有客户页面(client page)共用的内容放在模板页面(template page)中,被某些客户页面共用的内容放在单独文件中,然后用ui:include将其加载到需要的地方。

2.被包含页面

• 把内容放在ui:composition之内,注意命名空间。ui:composition之外的内容在加载时将被忽略。

• 放在单独文件里,最好放在另一个文件夹(如sinppets/、includes/)。

• 内容必须遵从XML语法格式。

• 被包含页面也可 以使用模板文件,但是模板文件中的最顶层标签是<ui:composition>而不是<html>,因为需要的是片段内容而不是html文件.

三.使用问题

1.使用ajax异步刷新似乎无法动态改变ui:include的指向。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值