#58

Get More Refcardz! Visit refcardz.com

Brought to you by...

cOntentS inclUDe:
n n

n

n

n

n

JSF Overview Development Process Lifecycle The JSF Expression Language JSF Core Tags JSF HTML Tags and more...

JavaServer Faces 2.0
By Cay Horstmann
Button
page.xhtml
<h:commandButton value=”press me” action=”#{bean1.login}”/>

JSF Overview
JavaServer Faces (JSF) is the “official” component-based view technology in the Java EE web tier. JSF includes a set of predefined UI components, an event-driven programming model, and the ability to add third-party components. JSF is designed to be extensible, easy to use, and toolable. This refcard describes JSF 2.0.

WEB-INF/classes/com/corejsf/SampleBean.java
@ManagedBean(name=”bean1”) @SessionScoped public class SampleBean { public String login() { if (...) return “success”; else return “error”; } ... }

DevelOpment prOceSS
A developer specifies JSF components in JSF pages, combining JSF component tags with HTML and CSS for styling. Components are linked with managed beans—Java classes that contain presentation logic and connect to business logic and persistence backends.

The outcomes success and error can be mapped to pages in faces-config.xml. if no mapping is specified, the page /success.xhtml or /error.xhtml is displayed.

Radio Buttons
page.xhtml
<h:selectOneRadio value=”#{form.condiment}> <f:selectItems value=”#{form.items}”/> </h:selectOneRadio>

www.dzone.com

servlet container
client devices

web application
presentation application logic navigation validation event handling Managed Beans web service business logic database

WEB-INF/classes/com/corejsf/SampleBean.java
public class SampleBean { private static Map<String, Object> items; static { items = new LinkedHashMap<String, Object>(); items.put(“Cheese”, 1); // label, value items.put(“Pickle”, 2); ... } public Map<String, Object> getItems() { return items; } public int getCondiment() { ... } public void setCondiment(int value) { ... } ... }

JSF Pages

JSF framework

In JSF 2.0, it is recommended that you use the facelets format for your pages:
<?xml version=”1.0” encoding=”UTF-8”?> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml” xmlns:f=”http://java.sun.com/jsf/core” xmlns:h=”http://java.sun.com/jsf/html” xmlns:ui=”http://java.sun.com/jsf/facelets”> <h:head>...</h:head> <h:body> <h:form> ... </h:form> </h:body> </html>

JavaServer Faces 2.0

JBoss Developer Studio 2.0
• Build web apps using rich JSF components • Choose from 120+ skinnable RichFaces components • Includes Seam, Hibernate, Drools, JBoss Portal and much more For more on JBoss and JSF 2.0, goto

These common tasks give you a crash course into using JSF.

Text Field
page.xhtml
<h:inputText value=”#{bean1.luckyNumber}”>

WEB-INF/classes/com/corejsf/SampleBean.java
@ManagedBean(name=”bean1”) @SessionScoped public class SampleBean { public int getLuckyNumber() { ... } public void setLuckyNumber(int value) { ... } ... }

jboss.org/jbossrichfaces/

DZone, Inc.

|

www.dzone.com

0 facesContext view component 2.xhtml <h:outputStylesheet library=”css” name=”styles. } Table with links The FacesContext instance of this request The UIViewRoot instance of this request The current component The current composite component Use resource[‘library:name’] to access a resource page.name calls getName or setName on the userBean object calls pizza...css . } public String deleteAction() { // delete the entry whose id is idToDelete return null. Inc.. list or array.xml <application> <resource-bundle> <base-name>com. <h:outputText value=”#{msgs. color: #eee.0 public class SampleBean { @Max(1000) private BigDecimal amount. you can write base.entries}” var=”row” styleClass=”table” rowClasses=”even. font-size: 1.login calls the login method on the userBean object when it is invoked.00 Using the Bean Validation Framework (JSR 303) 2.amount}” required=”true”> <f:validateDoubleRange maximum=”1000”/> </h:inputText> <h:outputText value=”#{bean1. yielding a String[] array of all values for a given name A Map of HTTP request parameters.choices[var] pizza.2 JavaServer Faces 2.greeting { font-style: italic.java public class SampleBean { private int idToDelete. The base is one of the names in the table below or a bean name. Example: userBean.get(var) or pizza.. } The number is displayed with currency symbol and group separator: $1.css” target=”head”/> .0: Method expressions can contain | DZone. As in JavaScript.5em. www. yielding a String[] array of all values for a given name A Map of the cookie names and values of the current request A Map of the initialization parameters of this web application A map of all attributes in the given scope WEB-INF/classes/com/corejsf/messages_de. .com .) Method expression: a reference to a method and the object on which it is to be invoked.properties goodbye=Goodbye A Map of HTTP header parameters. public void setIdToDelete(int value) { idToDelete = value. 2.properties goodbye=Auf Wiedersehen resources/css/styles. sessionScope. header headerValues param paramValues cookie initParam requestScope. containing only the first value for each name A Map of HTTP request parameters.corejsf.. } Ajax 2. } public List<Entry> getEntries() { ..put(var. Examples: userBean. } .deleteAction}” immediate=”true”> <f:setPropertyActionListener target=”#{bean1..0 WEB-INF/classes/com/corejsf/messages.messages</base-name> <var>msgs</var> </resource-bundle> </application> the JSF expreSSiOn langUage An EL expression is a sequence of literal strings and expressions of the form base[expr1][expr2].goodbye}!” styleClass=”greeting”> response Render Response Process events conversion errors/render response validation or conversion errors/render response faces-config. containing only the first value for each name A Map of HTTP header parameters.dzone.id}”/> </h:commandLink> </h:column> </h:dataTable> resource 2.000. applicationScope.getChoices().amount}”/> <h:message for=”amount”/> Restore View Apply Request Values render response response complete Process events Process Validations response complete Invoke Application Process events Update Model Values Resources and Styles page.name}”/> </h:column> <h:column> <h:commandLink value=”Delete” action=”#{bean1.odd”> <h:column> <f:facet name=”header”> <h:outputText value=”Name”/> </f:facet> <h:outputText value=”#{row.identifier instead of base[‘identifier’] or base[“identifier”]...xhtml <h:dataTable value=”#{bean1.getChoices().0 Value expression: a reference to a bean property or an entry in a map.0 cc 2. viewScope 2.idToDelete}” value=”#{row.0 Validation and Conversion Page-level validation and conversion: <h:inputText value=”#{bean1.0 <h:commandButton value=”Update”> <f:ajax execute=”input1 input2” render=”output1”/> </h:commandButton> liFecycle response complete response complete Process events Error Messages request <h:outputText value=”Amount”/> <h:inputText id=”amount” label=”Amount” value=”#{payment.amount}”> <f:convertNumber type=”currency”/> </h:outputText> WEB-INF/classes/com/corejsf/SampleBean..

0: EL expressions can contain JSTL functions fn:contains(str.noSelectionOption 2. or the length of a string .noSelectionOption 2.execute. substr) fn:containsIgnoreCase(str. disabled and escaped flags for each item in an array or collection of non-SelectItem elements.minimum. valueChangeListener: basic attributes Holds view parameters. generated events are broadcast during “Apply Request Values” phase instead of “Invoke Application” ..value: Value expression that points to a SelectItem instance . maxFractionDigits: Minimum. or both .0 f:actionListener f:valueChangeListener f:propertyAction Listener 1. which is passed to the server as a request parameter .listenter: A method expression of the type void (ComponentSystemEvent) throws AbortProcessingException f:ajax 2. indicated by ${. Default: click for buttons and links. converter. substr. preValidate.itemDisabled: false (default) to show the value . Use the variable name defined in var.value: The value to set it to Adds a phase listener to this page .0. Inc. postAddToView. stores properties as a Map .pattern: Formatting pattern. an array or Collection. | www.name: One of preRenderComponent. long or full .itemLabel 2.name: An optional name for this parameter component. value: the name of the parameter to set -binding. Button: submit. pastEnd) fn:substringAfter(str.listener: Method binding of type void (AjaxBehaviorEvent) .minIntegerDigits.name: the name of this facet Adds an attribute to a component .0. timeStyle: default. replacement) fn:toLowerCase(str) fn:toUpperCase(str) fn:trim() fn:escapeXml() f:selectItem Specifies an item for a select one or select many component . maximum: the minimum and maximum of the valid range Sets the required attribute of the enclosing component Specify validation groups for the Bean Validation Framework (JSR 303) Loads a resource bundle.0 f:metadata 2. h:form h:outputStylesheet 2. substr) fn:endsWith(str.convertedId: The ID of the converter Adds a datetime converter to a component . postValidate . JSP uses immediate evaluation.. substr) fn:startsWith(str.binding.currencySymbol: Currency symbol to use when converting currency values Adds a validator to a component . currency . separator) fn:split(str.name.type: The name of the listener class Adds a system event listener to a component .itemDescription: Description used by tools only . medium. time. May hold other metadata in the future f:selectItems JSF cOre tagS Tag f:facet f:attribute f:param Description/Attributes Adds a facet to a component . reset.0 parameters: userBean. or a Map mapping labels to values.var 2. value. short. h:button 2.0 f:validateBean 2. itemLabelEscaped 2.locale: Locale whose preferences are to be used for parsing h:inputSecret h:inputHidden h:outputLabel f:convertNumber Adds a number converter to a component .itemValue: Item’s value. as defined in java.text. Link that acts like a pushbutton.locale: Locale whose preferences are to be used for parsing and formatting . start.} delimiters.dzone. body. minFractionDigits.text.0. Hidden field Label for another component for accessibility HTML anchor.type: number (default).groupingUsed: True if grouping separators are used (default: true) .0 f:phaseListener 1.0. required..0: Value expression that yields the “no selection option” item or string that equals the value of the “no selection option” item Enables Ajax behavior . or pushbutton. h:outputScript 2.login(‘order page’) In JSF. change for input components .integerOnly: True if only the integer part is parsed (default: false) . Adds an action listener or value change listener to a component . onerror: JavaScript handlers for events/errors Defines a “view parameter” that can be initialized with a request parameter -name.0 h:inputText h:inputTextArea Description HTML head. Displays the most recent message for a component Displays all messages Displays an image register h:outputText h:commandButton.timeZone: Time zone to use for parsing and formatting (Default: UTC) SimpleDateFormat .itemLabel: Text shown by the item . but formats compound messages Single-line text output. or percent .value:The value stored in this component.escape: true (default) if special characters should be converted to HTML entities . Password input control.2 f:viewParam 2.dateStyle.0. itemValue 2.validatorID: The ID of the validator Validates a double or long value. The expression is stored as a string and evaluated when needed. f:validateLength f:validateRequired 2.value: The name of the variable that is bound to the bundle map h:outputLink h:outputFormat Like outputText.currencyCode: ISO 4217 currency code to use when converting currency values . separator) fn:substring(str. h:link 2. render: Lists of component IDs for processing in the “execute” and “render” lifecycle phases . and formatting .pattern: Formatting pattern.type: The name of the listener class Adds an action listener to a component that sets a bean property to a given value .0 h:message h:messages h:grapicImage f:validator f:validateDoubleRange. id.2 f:event 2. .value: Value expression that points to a SelectItem. In contrast.0 h:commandLink.0 f:loadBundle h:selectOneListbox Single-select listbox DZone. .event: JavaScript event that triggers behavior. maxIntegerDigits.0. 2. maximum number of digits in the integer and fractional part . value.0: true if this item is the “no selection option” Specifies items for a select one or select many component . EL expressions are enclosed in #{. substr) fn:length(str) fn:indexOf(str) fn:join(strArray.0: Item label.onevent.0 JSF html tagS Tag h:head 2.0: Variable name used in value expressions when traversing an array or collection of non-SelectItem elements . f:converter f:convertDateTime Adds an arbitrary converter to a component . separator) fn:replace(str.type: date (default). separator) fn:substringBefore(str.h:body 2.immediate: If true.0.. description.target: The bean property to set when the action event occurs .} to indicate deferred evaluation.com .3 JavaServer Faces 2. DecimalFormat . validator. . as defined in java. id: Basic attributes . itemDisabled 2.basename: the resource bundle name . f:validateLongRange. Multiline text input control. form Produces a style sheet or script Single-line text input control. itemDescription 2. value: the name and value of the attribute to set Constructs a parameter child component .

alt. escapes <. h:inputSecret . onmousedown. size. onfocus. and & characters. rendered. styleClasstabindex. id. validator. onclick. ondblclick. style. title. Don’t include the # separator Method expression of type void (ActionEvent) For h:commandLink only—The character encoding of the linked reference For h:commandButton only—A context-relative path to an image displayed in a button. url. styleClass corresponds to HTML class) DHTML events charset image (button tags) onclick. onkeydown.com . required. lang. ondblclick. requires a value to be entered in the associated field DHTML events Attributes for h:commandButton and h:commandLink Attribute action (command tags) outcome 2. onkeypress. onmousemove. onmouseup immediate redisplay required rows binding. onfocus. the input field’s value is redisplayed when the web page is reloaded Require input in the component when the form is submitted For h:inputTextarea only—number of rows Basic attributes value binding. lang. maxlength. title onblur. onkeydown. value. styleClass. Default value is true Basic attributes HTML 4. valueChangeListener accesskey. text/html. the HTML input’s type will be image A boolean. onmousemove. lang. onclick. onclick. title Attributes for Attribute for h:outputLabel Description The ID of the component to be labeled. Inc. onkeyup. onmouseover. value alt. hreflang. None apply to h:inputHidden Attributes for Attribute h:outputLink Description Basic attributes accesskey. or reset. name 2. target onblur.0 pass-through attributes—alt. title h:form only: accept.0 actionListener HTML 4. onkeyup. converter. tabindex.4 JavaServer Faces 2. onmouseout. onkeydown. id. converter. id. disabled (h:commandButton only). onmouseup Basic Attributes id binding rendered value valueVhangeListener converter. dir. disabled. coords. rel. onkeypress. if true. value DZone. maxlength. If false (the default). converter. lang. onmousedown. width onblur. unless you specify the image attribute. if true.dzone. dir. image/gif. onkeydown. id. onchange. styleClass.0 h:selectOneMenu Single-select menu Attributes for Attribute escape h:outputText and h:outputFormat Description If set to true. usemap. dir. value style.0. style. style. onkeyup. rendered. onkeypress.0 binding.0 h:selectOneRadio h:selectBooleanCheckbox h:selectManyCheckbox h:selectManyListbox Set of radio buttons Checkbox Set of checkboxes Multiselect listbox binding. rendered. is submit.0 h:graphicImage Description The resource library (subdirectory of resources) and file name (in that subdirectory) Basic attributes HTML 4. styleClass.0 Attributes for h:body and h:form Attribute binding. rendered. ondblclick. onmousemove.0 (non-command tags) (non-command tags) Description Navigation outcome string or method expression of type String () Value expression yielding the navigation outcome Fragment to be appended to URL. onchange. id. If you specify this attribute. onunload h:form only: onblur. onkeyup. id. onmouseover. >. onsubmit immediate type Attributes for Attribute cols h:inputText .0 attributes (acceptcharset corresponds to HTML accept-charset. lang. value h:selectManyMenu h:panelGrid h:panelGroup h:dataTable h:column Multiselect menu HTML table Two or more components that are laid out as one A feature-rich table component Column in a data table Attributes for Attribute library 2. onkeypress. onmouseout. or audio/basic The label displayed by the button or link Basic attributes HTML 4. target. style. actions and action listeners are invoked at the beginning of the life cycle For h:commandButton: The type of the generated input element: button. rendered. typically a value binding A method expression of the type void (ValueChangeEvent) Converter or validator class name A boolean. None apply to h:inputHidden DHTML events. acceptcharset. onreset. h:inputTextarea . ondblclick. rendered accesskey. false suppresses rendering A component’s value. actions and action listeners are invoked at the end of the request life cycle. enctype Description Basic attributes fragment 2. The default. styleClass. and h:inputHidden Description For h:inputTextarea only—number of columns Process validation early in the life cycle For h:inputSecret only—when true. onchange. For h:commandLink and h:link: The content type of the linked resource. height. submit. longdesc. rendered dir. and size do not apply to h:inputTextarea. onmousemove. onmouseout. onmouseover h:body only: onload. shape. readonly. converter. onmouseover. Basic attributes binding. validator required Identifier for a component Reference to the component that can be used in a backing bean A boolean. rev. ismap. readonly. | www. title link tags only: charset. onmousedown. onmousedown. onselect DHTML events HTML 4. onmouseout. id. binding. onfocus. for example. onfocus.

title. false for h:message.0 rules summary var binding. all summary of the table’s purpose and structure used for non-visual feedback such as speech The name of the variable created by the data table that represents the current item in the value Basic attributes HTML 4. onkeyup.0 layout Specification for how elements are laid out: lineDirection (horizontal) or pageDirection (vertical)—h:selectOneRadio and h:selectManyCheckbox only selectMany tags only: the name of a collection class such as java. rendered style. columnClasses Attribute for errorClass.com . Default: false Specification for message layout: table or list— h:messages only A boolean that determines whether message details are shown. lang. onmouseover. immediate. onmousedown. rendered h:panelGroup Description Basic attributes HTML 4. onkeyup. lang. h:selectManyCheckbox . onmousemove. title. hsides. dir. onmousemove. required. rows.0 charset. onmouseup DHTML events cellspacing columns frame Attributes for: h:selectBooleanCheckbox . onfocus. style. styleClass. h:selectOneMenu . onkeypress. value dir. h:selectOneListbox . onmousemove. styleClass binding. onclick. columnClasses rules summary Attribute enabledClass. ondblclick. rendered. styleClass. onmousedown. h:selectManyMenu headerClass. infoStyle. valid values: groups. onkeyup. h:selectManyListbox . lhs. style.0 Attribute ui:define Description Give a name to content for use in a template -name: the name of the content DZone. style.TreeSet collectionType 2. hsides. onmousedown. warnStyle globalOnly layout showDetail Description The ID of the component whose message is displayed— applicable only to h:message CSS class applied to error/fatal/information/warning messages CSS style applied to error/fatal/information/warning messages Instruction to display only global messages—h:messages only.0 hideNoSelectionOption 2.util. onkeydown. value dir. onmouseout. footerClass rowClasses. valueChangeListener accesskey.0 Hide item marked as “no selection option” style. below. validator. title. onmouseout. columns. hreflang. onmouseover. rel.dzone. footerClass 1. above. shape. lhs. tabindex. tabindex. onkeydown. dir.2 h:column Description CSS class for the column’s header/footer Basic attributes tooltip binding. onkeypress. footerClass rowClasses. onmouseover. fatalClass. onclick. rendered.0 DHTML events HTML 4. styleClass. type HTML 4. | www. border CSS class for the table header/footer Comma-separated list of CSS classes for rows/columns Specification for lines drawn between cells. onmousemove. h:selectOneRadio . vsides. warnClass errorStyle. ondblclick. styleClass. rev. width onclick. A boolean that determines whether message summaries are shown. the tooltip is only rendered if showDetail and showSummary are true Basic attributes HTML 4. Inc.5 JavaServer Faces 2. above. styleClass.2. onchange. size. infoClass. target. valid values: groups. onmouseup. border CSS class for the table header/footer comma-separated list of CSS classes for rows/columns Specification for lines drawn between cells. ondblclick. onkeypress. width onclick. ondblclick. box. disabled. onfocus. Defaults are true for h:messages. onmouseout. style. id.0 Attributes for Attribute binding. A boolean that determines whether message details are rendered in a tooltip. onkeydown. id. onmouseup Basic attributes HTML 4. rendered. true for h:message.0 DHTML events selectedClass 2.0 border cellpadding Width of the table’s border Padding around table cells Spacing between table cells Number of columns in the table frame Specification for sides of the frame surrounding the table that are to be drawn. id. vsides. id. onmouseout. onmousedown. readonly. disabledClass Description CSS class for enabled/disabled elements— h:selectOneRadio and h:selectManyCheckbox only CSS class for selected/unselected elements— h:selectManyCheckbox only binding.0. lang. fatalStyle. onselect Basic attributes Attributes for Attribute bgcolor border cellpadding cellspacing first frame h:dataTable Description Background color for the table Width of the table’s border Padding around table cells Spacing between table cells index of the first row shown in the table Specification for sides of the frame surrounding the table should be drawn. valid values: none. coords. value. converter. rows. onmouseup showSummary Attributes for Attribute headerClass 1. id. border. lang. Defaults are false for h:messages. below. unselectedClass 2.0—border only for h:selectOneRadio and h:selectManyCheckbox. size only for h:selectOneListbox and h:selectManyListbox. box. onmouseover. onkeydown. rhs. title binding. all Summary of the table’s purpose and structure used for non-visual feedback such as speech onblur. columns. title onblur. onkeyup. onchange. valid values: none. onkeypress. DHTML events Attributes for h:message and h:messages headerClass. id. rendered Attributes for Attribute bgcolor h:panelGrid Description Background color for the table Facelets Tags 2. rhs.

0399 919. and re ject Pur led k roce to be ob av as q rela us p llbac be hand ed. step.c o m $7. size: starting intex. with integer properties begin. in any form or by means electronic.0 ui:insert If a name is given. Th for de nge king leto ithin invo hm w Faca cha Sing od tory n n n n nd le a outc ay ha an tial hand sm hen oten ject le to .com/books/jsf Cay Horstmann’s Website. ui:component. source code and more.IBfeature articles. sa sed s Stru s be an . Cay S.com Get Mo ef re R c DZone. con tinu ed re le a que st an d th ndle e ha ue req r doe sn’t st w ith th e ha nald cDo nM Jaso By have to ndle James Ward.horstmann. For four years.com ..java.d one . Inc.6 JavaServer Faces 2. Th s su . le O pro n pa DES sab iagram .” r #8 z. He was elected Java Champion in 2005. or transmitted.. ui:fragment ui:include ui:debug ui:remove aBOUt the aUthOr recOmmenDeD BOOk Core JavaServer Faces delves into all facets of JSF development. odd. Inc. offering systematic best practices for building robust applications and maximizing developer productivity. ould ce Use to fa an r sh A hist pro implem ents its ting. ling re g l Pa ship ng an tiona at varia the hand pose ssin func ueui tion iora . end. without prior written permission ConcreteHqpublisher.95 Build er Meth tory Fac t eigh Flyw ter rpre Inte B tor Itera C B State algo rit B Stra B y od Meth plate Tem teg Visit or Refcardz Feedback Welcome refcardz@dzone. array.com 9 781934 238615 Version 1.0300 ISBN-13: 978-1-934238-61-5 ISBN-10: 1-934238-61-9 50795 . and to the point.dzone. Reference: of the uest ( ) ern Con cre teH and () uest 1 ler +ha ndle re hand le a req uest ki by lin ng | ww z w.W le p le ob tern ethod bject be ab tab pat ultip ecific o should cep n M this if the m up the s sp an ac d e ents ject ime.com ww more than 3. short. Job orithm be giv knowle that is terface Pro e ch : De e time g ct b n e in S r le of al ed ca to have d obje of the er mp cop pil rato ut an Exa serv nes ss S at com exec e queue comm Deco Ob confi S Cla e th B d the n .0 s Copyright © 2009 DZone. blogs.678. Horstmann has written many books on C++. B an en als xy . relative to the current page ui:param Define a parameter to be used in an included file or template -name: parameter name -value: a value expression (can yield an arbitrary object) Repeats the enclosed elements -value: a List. Cay was VP and CTO of an Internet startup that went from 3 people in a tiny office to a public company. mechanical.co m it ! V is arz E: LUD IN C y TS bilit EN onsi NT esp CO of R in Cha and m Com reter rp Inte tor . Upcoming titles Drupal Grails Core Java Concurrency Java Performance Tuning Eclipse RCP HTML Wicket most popular Spring Configuration jQuery Selectors Windows Powershell Dependency Injection with EJB 3 Netbeans IDE JavaEditor Getting Started with Eclipse Very First Steps in Flex re f c Download Now a rd Refcardz. W ject q cep st Ob e re e ex call le th nd th hand s to ha ct obje ome. ILIT NS S f in o ty Cha nsibili o Resp d man om C B site po Com B B Me diato m r B B Me ento Ob or ject Beh avio ral O AIN “DZone is a developer’s dream. UT fcard F) desig of Reu r ple s re ss d o ABO oke xam ents des cla ttern our (G Inv de h lem n Pa of F worl suc s: E inclu esig cts D ang attern real ern is D AN Th P obje enting 23 G patt . first. index. architects and decision S S z w. stored in a retrieval system. . or otherwise. Adobe Systems one DZone communities deliver over 6 million pages each month to C e to th nce in fere ted k re s lis ctquic PA s. CH F >> ace terf r <<in andle () H uest req ndle +ha P RES O succ ess Sponsorship Opportunities sales@dzone. ending index of the iteration -var: variable name to access the current element -varStatus: variable name to access the iteration status.net/blog/cayhorstmann/ BUy nOw books. He is now a computer science professor at San Jose State University. including news. step and Boolean properties even. . cheatsheets. id: basic attributes Like ui:composition. or a file with a ui:composition or ui:component tag -src: the file to include. relative to the current page Like ui:composition. d is be a lem ks to se e passe de to of ob at runt handle imp b Use ec set til co t ld ch ges n A n ined being shou peats un paren ime ngua erm Whe not e la the runt or if it det ore s re uest som d tion proces e no m req g in metho cep n A e e ar a ndlin e ex ack th ther n ha rown in ndle th ll st until ptio th e ca Exce ion is sm to ha up th tered or ral un le cept echani passed avio co ex mp Beh . but does not ignore the content outside the tag Include plain XHTML. ral en uest ord to m betwe ctu twe req ndled in riant n. ispa ns: lgo b to b er jects lly o g it stem tter many d ge a iv b sy win ona Pa ana allo traditi Rece en o ers. DZone offers something for everyone. B C Y tutorials. but makes a JSF component -binding. in va late catio e ha s: U ilitie psu at c invo to b llbacks es or cture the Enca quest s th ttern sponsib d ca stru nt tim lity. Professional Cheat Sheets You Can Trust “Exactly what busy developers need: simple. All rights reserved.3 million software developers. and a uct MM inal Design . insert named content if defined or use the child elements otherwise. If no name is given. d Fac ract Abst r pte Ada B e ridg S C S makers. us ma ct cute Ori tter Com ) uple s obje nati ( +exe low l Pa eco is al rge cute ch xpla ona ed la e ..” says PC Magazine.678. is the series editor for Core Books at Prentice-Hall and a frequent speaker at computer industry conferences.. ResultSet. NC 27513 888. n latio pe: pe used e comm voke for ec m Whe ntim s re al Sco ely toty The in exp th ueue actu d imple wid clas Pro ject ed at ru ue is are utilizing a job q of the ue C Ob ues with y e que the que g to en dg que s. or object -offset. 1251 NW Maynard Cary. insert the content of the tag invoking the template -name: the name of the content Produces content from a template after processing child elements (typically ui:define tags) Everything outside the ui:composition tag is ignored -template: the template file. 2 ler nt and Clie photocopying. is en am Exa hen tion uest to has ack. Cay Horstmann’s Java Bloghttp://weblogs. step size. ore Itera tor dm dia d an Me rver tho se Me S Ob RN plate TTE Tem n n n n n n n ired Insp e by th GoF ller se Best ns tter Pa sign De Cha in e of R ns spo ibil ity. Java and object-oriented development. last Shows debug info when CTRL+SHIFT+a key is pressed -hotkey: the key to press (default d) -rendered: true (default) to activate Do not include the contents (useful for comments or temporarily deactivating a part of a page) ui:repeat ui:composition ui:component ui:decorate. Each m nd str tion ple CO orig ma k re con rma om ir im boo Softwa nt teC d to info the cre Clie the d Use om age nd Con () ns: d fr ente on. a es a bje ern IGN tt vid s.com/ Bro ugh t to you by.http://www. y the Beh nships n be ed rono tionalit y need ject ed ca to from ch ne b d ca an tio You ne s need asyn func sts is couple ith o that st the rn the without n it is rela que ar ls w ate ips Reque y of re be de cilit d patte ssing entatio particul nsh or Dea e. ati nb +exe bject nship form bjects Cre y ca an o tio e d to rate o d as ed rela ms. No part of this publication may be reproduced. t th eate Use rith tha e tr ject bas .

Sign up to vote on this title
UsefulNot useful