Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

pdf / 6-jsf

.pdf
Скачиваний:
20
Добавлен:
06.06.2015
Размер:
354.87 Кб
Скачать

JSF

Java Server Faces

v1.2

Компоненты

API для UI компонентов и управления их состоянием

Модель событий

Проверка введенных данных и их преобразование

Управление навигаций

I18N

Расширяемость

Две библиотеки тэгов для JSP

JSF Application

Состоит из:

JSP Pages

Backing beans

Configuration files

web.xml

Custom components, validators, converters, listeners, сustom tags

Шаги для создания приложения:

Mapping the FacesServlet instance.

Создание страниц с использованием tags & UI Components

Определение правил навигации между страницами.

Разработка backing beans.

Добавление декларации бинов в файл конфигурации.

UI Component Model

UIComponent classes которые определяют поведение и состояние UI components

Rendering model — определяет как отображать компоненты

Event & listener model — определяет как обрабатывать события от компонентов

Conversion model — конвертация данных

Validation model — регистрация валидаторов для компонентов

UI Component Classes

(UIComponentBase)

UIColumn

UICommand

UIData

UIForm

UIGraphic

UIInput

UIMessage

UIMessages

UIOutput

UIPanel

UIParameter

UISelectBoolean

UISelectItem

UISelectItems

UISelectMany

UISelectOne

UIViewRoot

Behavioral interfaces

ActionSource (для предыдущих версий)

ActionSource2

EditableValueHolderExtends ValueHolder, добавляет проверку данных, value-change events.

NamingContainer — каждый потомок должен иметь уникальный ID

StateHolder — компонент имеет состояние которое необходимо сохранять между запросами

ValueHolder — содержит значение которое может быть использовано в приложение

Component Rendering Model

Tag

Functions

Rendered As

Appearance

column

Represents a column of data in aA column of data in an HTML A column in a table

 

UIData component.

table

 

commandButton

Submits a form to the

An HTML<input

A button

 

application.

type=type> element,

 

 

 

where thetype value can be

 

 

 

submit, reset, or image

 

commandLink

Links to another page or

An HTML<a href>

A hyperlink

 

location on a page.

element

 

dataTable

Represents a data wrapper.

An HTML<table> element A table that can be

 

 

 

updated dynamically

form

Represents an input form. The

An HTML<form> element

No appearance

 

inner tags of the form receive

 

 

 

the data that will be submitted

 

 

 

with the form.

 

 

graphicImage

Displays an image.

An HTML<img> element

An image

Component Rendering Model

inputHidden Allows a page author to

<input

No appearance

An HTML

include a hidden variable

type=hidden> element

 

in a page.

 

 

inputSecret Allows a user to input a string without the actual string appearing in the field.

inputText Allows a user to input a string.

inputTextarea Allows a user to enter a multiline string.

message

Displays a localized

 

message.

messages

Displays localized

 

messages.

outputFormat

Displays a localized

 

message.

An HTML<input

A text field, which

type=password> element

displays a row of

 

characters instead of the

 

actual string entered

An HTML<input

A text field

type=text> element

 

An HTML<textarea>

A multi-row text field

element

 

An HTML<span> tag if

A text string

styles are used

 

A set of HTML<span> tags if A text string

styles are used

 

Plain text

Plain text

Component Rendering Model

outputLabel

outputLink

Displays a nested component asAn HTML<label> element

Plain text

a label for a specified input

 

 

field.

 

 

Links to another page or

An HTML<a> element

A hyperlink

location on a page without

 

 

generating an action event.

 

 

outputText

Displays a line of text.

Plain text

Plain text

panelGrid

Displays a table.

An HTML<table> element

A table

 

 

with <tr> and <td> elements

 

panelGroup

Groups a set of components

 

A row in a table

 

under one parent.

 

 

selectBooleanC heckbox

selectItem

Allows a user to change the

An HTML<input

A check box

value of a Boolean choice.

type=checkbox> element.

 

Represents one item in a list of An HTML<option> elementNo appearance items in a UISelectOne

component.

Component Rendering Model

selectItems

Represents a list of items in a

A list of HTML

No appearance

 

UISelectOne component.

<option> elements

 

selectManyCheckbox

Displays a set of check boxes from

A set of HTML <input> A set of check

 

which the user can select multiple

elements of type

boxes

 

values.

checkbox

 

 

selectManyListbox

Allows a user to select multiple

An HTML

<select>

A list box

 

items from a set of items, all

element

 

 

 

displayed at once.

 

 

 

selectManyMenu

Allows a user to select multiple

An HTML

<select>

A scrollable

 

items from a set of items.

element

 

combo box

selectOneListbox

Allows a user to select one item

An HTML

<select>

A list box

 

from a set of items, all displayed at

element

 

 

 

once.

 

 

 

selectOneMenu

Allows a user to select one item

An HTML

<select>

A scrollable

 

from a set of items.

element

 

combo box

selectOneRadio

Allows a user to select one item

An HTML

<input

A set of radio

 

from a set of items.

type=radio> element

buttons

Соседние файлы в папке pdf