Core JavaServer Faces

Book coverBug Report Page (Second Edition)

Page 11
In step 3 for Windows, change cd ch1\login\web to cd ch1\login\src\java. Change mkdir WEB-INF\classes to mkdir ..\..\web\WEB-INF\classes.
Page 30
Change “tags such as f:form” to “tags such as h:form”
Page 34
Change "In the Process Validations phase, the submitted string values are first converted to “local values,” which can be objects of any type. When you design a JSF page, you can attach validators that perform correctness checks on the local values." to "The values stored in the component are called “local values”. When you design a JSF page, you can attach validators that perform correctness checks on the local values. These validators are executed in the Process Validations phase."
Page 42
Change “JavaServer Pages Standard Template Library” to “JavaServer Pages Standard Tag Library”
Page 42
Change “insrc/java/com/corejsf/” to “in src/java/com/corejsf/
Page 44
Change "Sie haben ... punkte" to "Sie haben ... Punkte" and "einen punkt" by "einen Punkt".
Page 45
Delete last > in <f:view locale="#{user.locale}"/>>
Page 79
Replace the code for the answerAction method with
public String answerAction() {
    tries++;
    if (problems[currentProblem].isCorrect(response)) {
        score++;
        nextProblem();
        if (currentProblem == problems.length) return "done";
        else return "success";
    }
    else if (tries == 1) {
        return "again";
    }
    else {
        nextProblem();
        if (currentProblem == problems.length) return "done";
        else return "failure";
    }
}
Page 81
In figure 3-6 the three failure arrows that point to the again bubble should be again arrows.
Page 88
In step 4, change “such as secure” to “such as /secure/*
Page 91
Change "That library, with 18 tags, is smaller..." to "That library, with 20 tags, is smaller..."
Page 93 Table 4-1
Change selectitems to selectItems and selectitem to selectItem
Page 93
Change “artibrary” to “arbitrary”
Page 93
Change vlude to value
Page 104
Change “There is no need for an anchor attribute” to “There is no need for an action attribute”
Page 105
Change
<h:inputText id="password" .../>
<h:inputText id="passwordConfirm" .../>

to

<h:inputSecret id="password" .../>
<h:inputSecret id="passwordConfirm" .../>
Page 117
Change "By default, the escape attribute is false, but if you set it to true, the following characters < > & are converted to &lt; &gt; and &amp; respectively." to "By default, the escape attribute is true, indicating that the following characters < > & are converted to &lt; &gt; and &amp; respectively."

Change “Default value is false.” to “Default value is true.”

Page 118 Table 4-13
Change item 3 to

<h:outputText value="#{form.htmlCode}" escape="false"/> where the getHtmlCode method returns the string "<input type='text' value='hello'/>"

Change item 4 to

<h:outputText value="#{form.htmlCode}"/> where the getHtmlCode method returns the string "<input type='text' value='hello'/>"

Page 126
Change “Both links specify an image, a request parameter, and an action method.” to “Both links specify an image and an action method.”
Page 145
Change
public SelectItem[] getBeverageItems() {
   return beverage;
}

to

public SelectItem[] getBeverageItems() {
   return beverageItems;
}
Page 147
Change “new ArrayListList<SelectItem>();” to “new ArrayList<SelectItem>();
Page 164
Change “rowClasses="evenRows, oddRows" and columnClasses="evenColumns, oddColumns"” to “rowClasses="oddRows, evenRows" and columnClasses="oddColumns, evenColumns" (assuming the row and column numbers start with 1).”
Page 172
Change “output_text” to “outputText” (2x)
Page 178
Remove styleClass, value from Table 5-2
Page 179
Change An array of names: to <h:outputText value="An array of names:"/>
Page 187
Change “output_text” to “outputText”
Page 205
Change
for (int i=0; i < rowCnt; ++i) {
rows[i] = new Row(i);

to

for (int i=0; i < rowCnt; ++i) {
   rows[i] = new Row(i);
}

Fix the indenting in

public void setRowIndex(int rowIndex) {
    if (rowIndex == -1 || rowIndex >= model.getRowCount()) {
    model.setRowIndex(rowIndex);
}
else {
    model.setRowIndex(rows[rowIndex].row);    }
}

to

public void setRowIndex(int rowIndex) {
    if (rowIndex == -1 || rowIndex >= model.getRowCount()) {
        model.setRowIndex(rowIndex);
    }
    else {
        model.setRowIndex(rows[rowIndex].row);
    }
}

(i.e. indent the four bold lines)

Page 207
In listing line 6, change site.css to styles.css
Page 220
In Figure 1, change "11/2007" to "04/2004"
Page 228
Change

“For h:messages, you usually want to set the layout attribute to "table" so that the messages are lined up vertically. Otherwise they are concatenated.

<h:messages layout="table"/>

TIP: Whenever you create a message, make sure it ends with a period and a space, to ensure a neat appearance when messages are concatenated.”

to

“The default value of the layout attribute for h:messages is "list", which yields an unnumbered list whose appearance you can control with a style sheet. Alternatively, you can up the messages vertically by using

<h:messages layout="table"/>

CAUTION: In JSF 1.1, the default behavior was to concatenate the messages. ”

Page 229, 230 Table 6-3
All " should be two single quotes ''
Page 231
In line 23 of the program listing, replace <h:panelGroup/> with
<h:message for="card" styleClass="errorMessage" /> 
Page 236
Remove the > at the end of
<h:inputText id="card" value="#{payment.card}" required="true">
Page 262
Change “Note the converter property of the last input field” to “Note the validator property of the last input field”
Page 268
Add a dotted arrow “no query data” from Restore View to Render Response (to make this figure identical to Figure 1-16).
Page 269
In the note, change FacesContext.renderResponse() to "the renderResponse method of the FacesContext class." Change FacesContext.responseComplete() to "the responseComplete method of the FacesContext class." Change the second FacesContext.renderResponse() to "the renderResponse method".
Page 275
Change “As we saw in “Life Cycle Events” on page 268, action events are fired” to “This occurs”
Page 275
Change actionListener="#{rushmore.listen}" to actionListener="#{rushmore.handleMouseClick}"
Page 275
Change public void listen(ActionEvent e) to public void handleMouseClick(ActionEvent e)
Page 288
Add a space after onchange="submit()"
Page 289
In item 2, change FacesContext.renderResponse() to "the renderResponse method of the FacesContext class."
Page 291
Change “Each listener sets the locale...” to “Each action method sets the locale...”
Page 294
Change "we provide a languageCode read-only property... " to "Change "we provide a languageCode write-only property... "
Page 324
Remove the line <property-class>java.lang.Integer</property-class>
Page 346
Drop listings 8-18 and 8-19.
Page 366
In the table, change the value for _id.yearSpinner to 2000 (or 2005), depending on whether you want to match Figure 9-1 or 9-2 :-)
Page 385
Change
Class[] paramTypes = new Class[] { ValueChangeListener.class };

to

Class[] paramTypes = new Class[] { ValueChangeEvent.class };
Page 407 JSSpinnerRenderer.java Lines 54, 59
Change max to max.toString() and min to min.toString(). (Otherwise, values > 999 will be rendered with decimal separators.)
Page 411
Change rendersChildren to getRendersChildren (2x)
Page 418
Change Object values[] = new Object[3]; to Object[] values = new Object[2];
Page 442
Change "However, the custom validator tag must extend the ValidatorTag class." to "However, the custom validator tag must extend the ValidatorELTag class."
Page 443
Remove the API note for javax.faces.webapp.ValidatorTag
Page 463
Change sun-web.xml to WEB-INF/sun-web.xml.
Page 484
Change "The classes that need to access the database use JNDI look up the data source." to "The classes that need to access the database use JNDI to look up the data source." Change "This resource be used by all web applications..." to "This resource will be used by all web applications..."
Page 519
Remove one of the glassfish/lib/appserv-ws.jar from “include glassfish/lib/appserv-ws.jar, glassfish/lib/appserv-ws.jar, and aws.jar in the class path”
Page 520
Change “the Java Web Services Developer Pack (JWSDP) from http://java.sun.com/webservices/jwsdp. Refer to the JWSDP documentation” to “the Metro web service stack from http://metro.dev.java.net. Refer to the Metro documentation”
Page 529
Change “acheive” to “achieve”
Page 530
Change “illicits” to “elicits”
Page 534
Remove the comma after processZipCodeSelection
Page 556
Change “the single zip code recognized by the application” to “a zip code recognized by the application”
Page 557
Change "When the zip code field receives focus...action listener is our backing bean's setCityAndStateForZip method." to "When the zip code field receives focus...action listener is our backing bean's clearCityAndStateForZip method." and "When the zip code field loses focus...action listener is our backing bean's clearCityAndStateForZip method." to "When the zip code field loses focus...action listener is our backing bean's setCityAndStateForZip method." (i.e., flip clear and set).
Page 588
Add xmlns:h="http://java.sun.com/jsf/html" after xmlns:f="http://java.sun.com/jsf/core"
Page 596
Change
<h:outputText value="#{header}" style="color: red;"/>

to

<h:outputText value="#{headers}" style="color: red;"/>
Page 606
Change “ensare” to “obtain”
Page 613
Change http://www.cle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/index.html to http://www.oracle.com/technology/products/adf/adffaces/index.html
Page 613 Table 13-1
Change calendar to inputCalendar
Page 624
Change “Chapter 12 of the Java EE 5 tutorial” to “Chapter 13 of the Java EE 5 tutorial”
Page 653
Break the URL for http://myfaces.apache.org/tomahawk/panelStack.html after tomahawk/ so that it doesn't have a hyphen.
Page 679
Change “When a request, session, or application scope ends, the methods of all managed beans in the scope that are annotated with @PostConstruct will be invoked.” to “When a request, session, or application scope ends, the methods of all managed beans in the scope that are annotated with @PreDestroy will be invoked.”
Page 693
Change “Log Levels child” tab to “Log Levels” child tab.

Thanks to Eugene Bendersky, Mark Boatman, Joy Beer, Ognjen Blagojevic, Guus Bonnema, Luca Borzani, Chuck Burchard, John Chen, Tim Colburn, Lewis Coosner, Michele Costabile, Chris Dailey, Juan C Esquivel, Ian Finch, Shawn Flahave, Jeremy Flowers, Mitch Gart, Eef Goeyenbier, Jeremy Goodwin, Stephan Gross, Scott Healy, Nick Karlsson, Chow Yip Keung, Karl Krasnowsky, Pieter Kuijpers, Michael Kulla, Donna Lamb, Else Lervik, Robert Liguori, J. Luis Lominchar, Borzani Luca, Sergey Margaryants, Tom Nagle, Tor-Erik Nesse, Larry Sanford, Scott C. Schank, Aaron Shettleroe, Klaus Stähler, Gerald Struck, Marc Thompson, Jason Tovey, Andreas Watermeyer, Robert Welters, Shane Wilson, Daoqi Yang, Aldo Ahmed Solis Zenteno, and (your name might go here) for their help!

Please report any remaining bugs in this edition on the bug report form.