Developing Web 2.0 applications
with JavaServerFaces
and Dreamweaver
>> Just Became Easier
Documentation
Search
  1. Introduction
  2. Getting Started
  3. Facelets Concepts
  4. Document Types
  5. Design View
  6. Code View Support
  7. Keyboard Shortcuts
  8. Tag Object Toolbars
  9. Property Inspectors
  10. Facelets Tag Reference
Facelets UI Tag Library
Selected ui:component
  ui:composition
  ui:debug
  ui:decorate
  ui:define
  ui:fragment
  ui:include
  ui:insert
  ui:param
  ui:remove
  ui:repeat
If you like this documentation, please take a look at my book:

10. Facelets UI Tag Reference

Documentation > Facelets > Facelets Tag Reference > Facelets UI Tag Library > ui:component

ui:component

The UI Component tag inserts a new UIComponent instance into the JSF component tree. Any components or content fragments outside this tag will be ignored by the Facelets view handler. Any components or content fragments within this tag will be added to the component tree as children of the UIComponent instance. See also ui:fragment.

JSF Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<body>
Text before will be ignored.
<ui:component binding="#{myController.component}">
	<div>
		Hello World!
	</div>
</ui:component>
Text after will be ignored.
</body>
</html>
This example was formatted by JSFToolbox for Dreamweaver.

HTML Output

<div>Hello World!</div>

Tag Attributes

binding Expression
 
Binds the component to a backing bean property, as specified in the JSF specification.
id Text
 
The identifier of the component that JSF inserts into the component tree. If an identifier is not explicitly specified by the page author, JSF will assign an identifier based on the algorithm that it uses for all components.