core jsf第四章


第四章.JSF标准标签

本章主题

Development of compelling JSF applications requires a good grasp of the JSF tag libraries—core and HTML—that represent a combined total of 43 tags. Because of their prominence in the JSF framework, this chapter and the next—Data Tables—provide in-depth coverage of those tags, their attributes, and how you can best use them.

Even simple JSF pages use tags from both libraries. Many JSF pages have a structure similar to this:

要想开发出引人注目的JSF应用程序需要熟练掌握jsf核心标签库和HTML标签库,总计43个标签。鉴于他们

在JSF框架中的重要地位,本章和下章(数据表)将代你深入的探讨它们的属性以及如何让你更好的使用他们。

即使最简单的JSF页面也会同时使用这两个标签库.大多数JSF页面会拥有如下相似的代码结构:

     
     
<% @ taglib uri = " http://java.sun.com/jsf/core "  prefix = " f "   %>

<% @ taglib uri = " http://java.sun.com/jsf/html "  prefix = " h "   %>



< f:view >

    
< h:form >

        ...

    
</ h:form >

</ f:view >

To use the JSF tag libraries, you must import them with taglib directives, as in the preceding code fragment. You can choose any name you want for the prefixes. The convention is f and h, for the core and HTML libraries, respectively.

要想使用JSF标签库,你必须如上述代码那样使用taglib指示命令 引用它们.你可以为prefix前缀属性取用任意你喜欢的名字。一般分别使用f和h来代表核心标签库和HTML标签库。

This chapter starts with a brief look at the core library. That library, with 18 tags, is smaller than its HTML sibling, which has 25. It's also considerably simpler than the HTML library. Because of that simplicity and because most of the core tags are discussed elsewhere in this book, the overwhelming majority of this chapter focuses on the HTML library.

本章从核心标签库的简单介绍开始。 核心库包含18个标签,比包含25个标签的HTML标签库要小。同时它也比HTML标签库简单许多。正因为如此加上核心标签库在本书的其他地方亦有讨论,所以本章重点讨论HTML标签库。

We begin our exploration of the HTML library with a look at common attributes shared by most JSF HTML tags. Then we discuss each tag individually with attribute tables for reference and useful code examples that you can adapt to your own applications.

我们会从大部分JSF HTML标签共有的属性开始我们的探讨,接着我们会单独的讨论每一个 HTML 标签,讲解它们的每一个属性,提供一些有用的代码示例,你可以在你自己的应用程序中使用。

NOTE

注意

 

The core library has 2.8 attributes per tag—the HTML library has 26.2.

核心标签库每个标签平均有2.8个属性,而HTML标签库则有26.2个之多.


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值