Core JavaServer Faces

Book coverBug Report Page (Third Edition)

How to Tell which Printing You Have

On the bottom of the copyright page (facing the first page of the table of contents), look for a line such as
First printing, April 2010

In the errata below, we indicate the printing in which the error has been fixed inside square brackets such as [4].

For example, suppose you have the fourth printing. Then you can ignore all reports that are prefixed with [2], [3] or [4]. But you would want to pay attention to all reports that are prefixed with [5] or higher or that have no bracketed prefix at all.

[2] Page 11
Change
cd ../..
jar cvf login.war .

to

cd ../../web
jar cvf ../login.war .
[2] Page 17
Change “The easiest way of specifying the name and scope of a managed bean is to use attributes” to “The easiest way of specifying the name and scope of a managed bean is to use annotations”
[2] Page 20
Change “The JSF implementation strips off the faces prefix” to “The JSF implementation strips off the .faces extension”
[2] Page 38
Remove “ is invoked when the component is rendered”
[2] Page 39
Change “an output component is constructed” to “an input component is constructed”
[2] Page 46
Remove “• problems: a write-only property to set the quiz problems” and “The problems property is unused in this sample program—we initialize the problem set in the QuizBean constructor. However, under “Configuring Managed Beans with XML” on page 58, you will see how to set up the problem set inside faces-config.xml, without having to write any code.”
[2] Page 50 Listing 2-3
Remove the setProblems method in lines 31-36
[2] Page 54
Change “Perhaps surprisingly, session beans are not single-threaded” to “Perhaps surprisingly, session-scoped beans are not single-threaded”
[2] Page 56
Change public class EditBean to public class EditBean implements Serializable
[2] Page 58
Change “NOTE: The @PreDestroy and @PostDestruct annotations” to “NOTE: The @PostConstruct and @PreDestroy annotations”
[2] Page 60
Change <value>#{user}</value to <value>#{user}</value>
[2] Page 70
Change #{messages.greeting} to #{msgs.clickHere}
[2] Page 83
Change
      else if (tries == 1) return "again";

to

      else if (tries == 1) return "failure";
      
[2] Page 84
Change <p>#{quizBean.question}"/></p> to <p>#{quizBean.question}"</p>
[2] Page 88
Change
ExternalContext.getFlash().put("message", "Your password is about to expire");

to

ExternalContext external = FacesContext.getCurrentInstance().getExternalContext();
external.getFlash().put("message", "Your password is about to expire");
[2] Page 119
Change “There is no need for an anchor attribute” to “There is no need for an action attribute”
[2] Page 132, 137
Change resources[ to resource[
[2] Page 138
Change #{msgs.linkText}> to #{msgs.linkText}

Change “The h:commandLink and h:link tags” to “The h:commandLink tag”

[2] Page 154
In the last row of Table 4-25, change "the `no-selection' option that, when selected indicates that the user intends to make no selection" to "included for navigational purposes and should not be selected"
[2] Page 161
In the last line, change h:selectOneRadio to h:selectOneMenu
[2] Page 166
Remove selectedClass="selected"
[2] Page 167
Remove target="head"
[2] Page 174
Change #{form.age} to #{user.age}
[2] Page 186
Change
<ui:define name="windowTitle">

to

<ui:define name="windowTitle">
   #{msgs.planetariumTitle}
</ui:define> 

(Note the boldface in the second line)

[2] Page 201
Replace <![CDATA[ with //<![CDATA[ and ]]> with //]]>
[2] Page 215
Change columnClasses="oddColumn,evenColumn" to columnClasses="firstColumn,secondColumn".
[2] Page 216
Change .oddColumn to .firstColumn and .evenColumn to .secondColumn

Change “In this case, h:dataTable reuses the column classes, starting with the first. By specifying only the first two column classes, we can set the CSS classes for odd and even columns. (When using the terms odd and even in this way, we assume that the first column is column 1.)” to “The remaining columns are not given a CSS class.”

Change “Like column classes” to “Unlike column classes”

Append the following to the last paragraph: “(When using the terms odd and even in this way, we assume that the first column is column 1.)”

[2] Page 230
Change javax.sql.CachedRowset to javax.sql.rowset.CachedRowSet and javax.servlet.jsp.jstl.Result to javax.servlet.jsp.jstl.sql.Result
[2] Page 236
Change model.setRowIndex(rows[i]); to model.setRowIndex(rows[rowIndex]);
[2] Page 244
Change “In the next chapter, we show you how your application can react to user and system events.” to “In the next chapter, you will see how JSF validates user input, and how it redisplays invalid inputs so that the user can correct them."
[2] Page 248
Change “Instead, they are first stored inside the component objects as local values. After conversion, the local values are validated. Application designers can specify validation conditions—for example, that certain fields should have a minimum or maximum length. We begin our discussion of validation under “Using Standard Validators” on page 262. After all local values have been validated”

to

“Instead, they are first validated and, upon successful validation, stored inside the component objects as local values. Application designers can specify validation conditions—for example, that certain fields should have a minimum or maximum length. We begin our discussion of validation under “Using Standard Validators” on page 262. After all submitted values have been converted and validated”

Change “The Update Model Values phase starts only if all validations are successful.” to ““The Update Model Values phase starts only if all conversions and validations are successful.””

[2] Page 263
Change the table header “JSP Tag” to “JSF Tag”
[2] Page 282
Change app.getResourceBundle to app.getMessageBundle
[2] Page 298, 299, 301
Change com.corejsf.CreditCard to com.corejsf.Card (2x on page 298)
[2] Page 313
Change public void listen(ActionEvent e) { to public void handleMouseClick(ActionEvent e) {
[2] Page 318
Change “candiate” to “candidate”
[2] Page 325
Change changeLocale(String languageChange) to changeLocale(String languageCode)
[2] Page 330
Change name="postValidate" to type="postValidate"
[2] Page 336
Change public class UserBean to public class UserBean implements java.io.Serializable
[2] Page 340
Change “JSP include directive” to ui:include directive”
[2] Page 357
Change <composite:attribute user="user"/> to <composite:attribute name="user"/>
[2] Page 377
Remove “In our case, each h:selectOneMenu component has an integer converter that converts the incoming string to an Integer.”

Change “it becomes the value of the component.” to “it becomes the local value of the component.”

[2] Page 377, 381
Change 
int day = (Integer) dayComponent.getValue();
int month = (Integer) monthComponent.getValue();
int year = (Integer) yearComponent.getValue();

to

int day = Integer.parseInt((String) dayComponent.getSubmittedValue()); 
int month = Integer.parseInt((String) monthComponent.getSubmittedValue()); 
int year = Integer.parseInt((String) yearComponent.getSubmittedValue()); 
[2] Page 394
Change style="color: red"s to style="color: red"
[2] Page 398
Change “Must be one of: begin, complete, or error.” to “Must be one of: begin, complete, or success.”
[2] Page 410
Change “autcomplete” to “autocomplete”
[2] Page 411
Change Locations to #{msgs.locationsPrompt}.

Change

@ApplicationScoped

to

@Named
@ApplicationScoped

Change public class AutoComplete to public class AutoComplete implements Serializable

[2] Page 415
Change
         String s = item.substring(0, inputValue.length());
         if (s.equalsIgnoreCase(inputValue))
to
         if (item.toLowerCase().startsWith(inputValue.toLowerCase()))
[2] Page 418
Change the title from ”CUSTOM COMPONENTS, CONVERTERS, AND VALIDATORS” to “CUSTOM COMPONENTS”.
[2] Page 470
Change “Listing 11–12 shows how the UITabbedPane class saves and restores its state. Listing 11–13 shows the JSF page for the tabbed pane application.” to “Listing 11–12 shows the JSF page for the tabbed pane application. Listing 11–13 shows how the UITabbedPane class saves and restores its state.”
[2] Page 514, 515
Change “data access objects” to “data transfer objects”
[2] Page 548
Change “The ADF Faces component set by Oracle (http://oracle.com/technology/products/adf/adffaces) is free, but not open source. It too features” to “The ADF Faces component set by Oracle (http://oracle.com/technology/products/adf/adffaces) features”
[2] Page 506
Change
try
{

to

try {

Change

count = result.getInt("logincount");

to

if (!loggedIn) return;
count = result.getInt("logincount") + 1;
[2] Page 552
Remove import javax.servlet.annotation.WebFilter; (line 16)

Thanks to Ashish Adhikari, Igor Akkerman, Mohamad Alamili, Rafael Ubiratam Clemente Afonso, Gary Bello, Theo Bittencourt, Andy Carpenter, Mustafa Dasgin, Luis Eduardo Telaya Escobedo, Lee Kian Giap, Christopher Glass, Richard Grin, Søren Nødskov Hansen, Yasser Hawari, Reinhard Horn, Richard Hull, Sachihiko Kadotani, Albert Kam, Guenter Koch, Sudhakara Konduru, Keith Levi, Yingxue Lin, Bruce Link, Clifford Lum, Hipolito Matute, Konstantin Milyutin, Abel Morelos, Dagbjørn Nogva, Tiago Nunes, Anil Ozselgin, Anders Ottosson, Karl Phillip, David Pitfield, Dave Powell, Konstantin Ptitsyn, Rafal Olenski, Richard Ragan, Mohammed Reziq, Philip Ritzkopf, A. Satyadi, Bauke Scholtz, Shawn Severin, Ryan Slominski, Josivan Pereira de Souza, Gerald Struck, Pierre Sugar, Swathi Vegesna, Guillaume Wasiewski, and (your name might go here) for their help!

Bug Report Form

Please use this form to report any bugs that you find. Please check the list of known bugs and the list of frequently asked questions first before you report a bug. Unfortunately, we do not have the time to respond personally to every report, but we do read them all and will post updates to this page. Thank you!

Your name:
Your email address:
Edition:
Page number:

Problem description:

To protect against spam robots, please answer this simple math problem:
* =