Errata

JavaServer Faces

Errata for JavaServer Faces

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed
Page p253
last paragraph, second line

"in the faces-config.xml class" should be "in the faces-config.xml
file"

Anonymous   
Printed
Page 7
Figure 1-2 caption

"Figure 1-2. JThe..." should be "Figure 1-2. The..." (extraneous 'J')

Anonymous   
Printed
Page 14
Figure 2-2

"UIintput" component should be "UIInput"

Anonymous   
Printed
Page 18
Example 2-1

Second table row in sample code starts with <td> tag instead of <tr> tag:

</tr>
<td> <!-- should be <tr> instead -->
<td>News Letters:</td>

Anonymous   
Printed
Page 19
Figure 2-3

"<h:input_text ...>" should be "<h:inputText ...>"

Also, In the lower-right-hand corner of the graphic, "faces-config.xml" is misspelled as "faces-confix.xml".

Anonymous   
Printed
Page 19
Figure 2-3, box labeled "faces-confix.xml"

"manged-bean-name" should be "managed-bean-name" (two instances).
"subsr" should be "subscr".

Anonymous   
Printed
Page 19
4th paragraph, first line, right under Figure 2-3

"When the <h:textInput> element is processed, the corresponding UIInput compo-"

"<h:textInput>" should be replaced with <h:inputText>"

Anonymous   
Printed
Page 32
3rd Paragraph

HTTP = Hypertext Transfer Protocol, not Transport

Anonymous   
Printed
Page 45
half way down page

"...invoke your servlet when it recieves a request..."
should be:
"...invoke your servlet when it receives a request..."

Anonymous   
Printed
Page 45
The URL pattern on page 45 should be

<servlet-mapping>
<servlet-name>helloYou</servlet-name>
<url-pattern>/helloYou/*</url-pattern>
</servlet-mapping>

Anonymous   
Printed
Page 48
Filters and Listeners paragraph

These compont types are also often...
should be:
These component types are also often...

Anonymous   
Printed
Page 52
Bottom of page

The footer.jsp source should be shown after Example 4-3 and Figure 4-9 should show it's output.
The footer.jsp source could look like this:

<hr>
Copyright 2004 My Company

Anonymous   
Printed
Page 57
Top paragraph

(e.g., < and &)
should be:
(e.g., > and &)

Anonymous   
Printed
Page 60
1st paragraph, line 5

The URL
http://jakarta.apache.taglibs/
should be
http://jakarta.apache.org/taglibs/

Anonymous   
Printed
Page 60
Top para

The paragraph ends with
"all dependent JAR file must also be installed in the WEB-INF/lib directory."
should be:
"all dependent JAR files must also be installed in the WEB-INF/lib directory."

Anonymous   
Printed
Page 60
3rd paragraph, line 5

In your JSP page, just to use a taglib...
should be:
In your JSP page, just use a taglib...

Anonymous   
Printed
Page 62
1st paragraph

The first paragraph on page 62 should actually be removed; it
refers to an example ("product catalog example") which doesn't exist.

Anonymous   
Printed
Page 62-63
Code at bottom of 62 and middle of 63

It says "Sorry, not products..." in both places.
it should say "Sorry, no products..."

Anonymous   
Printed
Page 66
Paragraph following Figure 5-2.

"different storage medias" should be "different storage media".

Anonymous   
Printed
Page 70
Paragraph 2 and code sample

Names of methods in text do not quite match code.
The names in the text should be getCurrentEntryId() and setCurrentEntryId() instead of getCurrentEntry() and setCurrentEntry()

Anonymous   
Printed
Page 73
bottom

matches a search criteria.
should be:
matches a search criterion.

Anonymous   
Printed
Page 81
top of page

This web.xml descriptor fragment is incorrect.
It is missing the enclosing <form-login-config> tag.
It should be:
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/loginerror.jsp</form-error-page>
</form-login-config>
</login-config>

Anonymous   
Printed
Page 94
example in page

In the example, the "to:" input -

<input type="submit" name="_id0:_id2">
should be :
<input type="text" name="_id0:_id2">

Anonymous   
Printed
Page 98
6th paragraph; Second sentence says:

First, the path starts with a /jspbook prefix.
should be:
First, the path starts with a /jsfbook prefix.

Anonymous   
Printed
Page 103
First complete paragraph

The inline example of combining a bean property value with an EL operator is incorrect.
"#{report.status == 'open'}" should be "{#report.status == 1}".

Anonymous   
Printed
Page 107
last paragraph

instead of "... so it consults the jsf-config.xml ..."
it should be "... so it consults the faces-config.xml ..."

Anonymous   
Printed
Page 109
end of 2nd dotted paragraph

... the component loses its state when its removed from the view.
should be:
... the component loses its state when it's removed from the view.

Anonymous   
Printed
Page 109
Example code for Figure 6-6

The code that generates the "You're logged in as..." text and provides the links for
logout and preferences permaturely close the h:outputLink tags.

e.g. code sample says:
[<h:outputLink value="../../logout.jsp" />
<h:outputText value="Logout" />
</h:outputLink>]

it should say:
[<h:outputLink value="../../logout.jsp">
<h:outputText value="Logout" />
</h:outputLink>]

Anonymous   
Printed
Page 110
bottom of code block

The opening <h:outputLink> tags are incorrectly printed as empty tags.
They should be closed with a ">" instead of "/>" as printed.

Anonymous   
Printed
Page 119
bottom of HTML markup

The value binding for the commandButton
#{reportHandler.addEntryDisabled}
should be
#{reportHandler.editDisabled}

Anonymous   
Printed
Page 119
Example 7-2.

under the lines with both <f:convertDate... and <f:validateDoubleRange...
the </h:input_text> tag should be </h:inputText>

Anonymous   
Printed
Page 120
Table 7-3

First paragraph under Description label:

...is a decimal above a minimum or a maximum
should be:
...is a decimal above a minimum or below a maximum

This paragraph under Description label:

...is a nondecimal above a minimum or a maximum
should be:
...is a nondecimal above a minimum or below a maximum

Anonymous   
Printed
Page 123
2nd paragraph, line 2

"a <f:selectItems> action" should read "an <f:selectItems> action."

Anonymous   
Printed
Page 124
1st paragraph

end of last sentence:
... that sets the ... properties, and leave the description undefined.
should be:
... that sets the ... properties, and leaves the description undefined.

Anonymous   
Printed
Page 125
Last paragraph, line 8

Variable expenseType should be expenseTypes

Anonymous   
Printed
Page 126
Last paragraph, line 3

"application-specific message" should be "application-specific messages."

Anonymous   
Printed
Page 127
Second paragraph, line 2

The phrase "actions shows" should be "actions show.

Anonymous   
Printed
Page 129
Example 7-3

"detailedMsgPattern" NOW READS "detailMsgPattern" in this statement:

String detailMsg =
MessageFormat.format(detailMsgPattern, params);

Anonymous    Aug 01, 2004
Printed
Page 130
Last paragraph, line 2

this should be rephrasedlike this:
The EditableValueHolder interface extends the ValueHolder interface,
adding properties related to a user provided value. A class that
represents a component type with a value the user can change (e.g.,
the class for the UIInput component) must implement the
EditableValueHolder interface.

Anonymous   
Printed
Page 131
3rd paragraph, line 6

not_later should be not_later_detail.

Anonymous   
Printed
Page 133
First paragraph in Using a Custom Validator in a JSP Page,

second line

"To use a custom validator in a JSP page, you need a JSP custom
action that configures the converter and attaches it to a component."

"converter" should be "validator"

Anonymous   
Printed
Page 134
Third paragraph in Developing a Validator Custom Action,

fifth line:

"Example 7-8" should be "Example 7-6"

Anonymous   
Printed
Page 135
4th paragraph, line 4

"an JSP" should read "a JSP."

Anonymous   
Printed
Page 135
Sixth paragraph, first line

"<my:validate_later>" should be "<my:validateLater>"

Anonymous   
Printed
Page 137
first example

<f:validator validatorId=" com.mycompany.jsf.validator.LATER_THAN" />
should be:
<f:validator validatorId="com.mycompany.jsf.validator.LATER_THAN" />

Anonymous   
Printed
Page 146
Example 8.3

import javax.faces.application.Message;

NOW READS:
import javax.faces.application.FacesMessage;

also, the line: import javax.faces.application.MessageResources; HAS BEEN DELETED.

Anonymous    Aug 01, 2004
Printed
Page 154
Third paragraph, second line

"includeExtensions" should be "includeSpecial"

Anonymous   
Printed
Page 165
last paragraph, 3rd line

...example, and in links to a...
should be:
...example, and it links to a...

Anonymous   
Printed
Page 168
line 15 in the code snippet

"context" is used as both the assigned variable name and the first
method argument. The argument should be replaced with a call to
the getServletContext() method, i.e.:

FacesContext context =
fcFactory.getFacesContext(getServletContext(), request, response,
lifecycle);

Anonymous   
Printed
Page 168
Example code

There are a few typos in the example. It should look like this:

LifecycleFactory lFactory = (LifecycleFactory)
FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
Lifecycle lifecycle =
lFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);

FacesContextFactory fcFactory = (FacesContextFactory)
FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
// The "context" argument replaced with "getServletContext()" below
FacesContext context =
fcFactory.getFacesContext(getServletContext(), request, response,
lifecycle);

Application application = context.getApplication();
ViewHandler viewHandler = application.getViewHandler();
// The "facesContext" argument replaced with "context" below
UIViewRoot view = viewHandler.createView(context,
"/myView.jsp");
context.setViewRoot(view);

// The "context" argument added
lifecycle.render(context);

Anonymous   
Printed
Page 175
Last paragraph

reportModel should be reportsModel

Anonymous   
Printed
Page 177
2nd snippet

In the book it shows

<navigation-rule>
<from-view-id>/expense/stage1/reportListArea.jsp</from-view-id>
<navigation-case>
<from-action>#{reportHandler.select}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/expense/stage1/entryListArea.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>

It should be:

<navigation-rule>
<navigation-case>
<from-action>#{reportHandler.select}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/expense/stage1/entryListArea.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>

The <from-view-id> shouldn't be there because the same rule applies to more than one view.

Anonymous   
Printed
Page 199
1st line (1st paragraph)

a file named lables_en_US.properties ...
should be:
a file named labels_en_US.properties ...

Anonymous   
Printed
Page 200
Example 11-2

"datestyle" should be "dateStyle"

Anonymous   
Printed
Page 201
Second paragraph

"datestyle" should be "dateStyle"

Anonymous   
Printed
Page 208
Example 11-4 <title> tag content

To go along with what is displayed in Figure 11-4, the <title> tag content should be changed FROM:

<title>Non-Western Languages Localization</title>
TO:
<title>Supporting Non-Western Languages</title>

Anonymous   
Printed
Page 211
first paragraph, first line

"The JSP page in Example 4-1 contains ..." should be "The JSP page in
Example 11-4 contains ..."

Anonymous   
Printed
Page 221
third paragraph, seventh line

"For an <h:inputComponent> with ..." should be "For an <h:inputText>
action element with ..."

Anonymous   
Printed
Page 226
sixth paragraph, second line

"http://www.Jakarta.apache.org/struts/" should be
"http://jakarta.apache.org/struts/"

Anonymous   
Printed
Page 229
Text and code sample of Example 12-10

Names of class in text does not match sample for struts version.
public class UpdateProfileAction extends Action {
should be:
public class StoreMsgAction extends Action {

Anonymous   
Printed
Page 235
first paragraph, ninth line

"and requires that the JSP component actions ..." should be "and
requires that the JSF component actions ..."

Anonymous   
Printed
Page 240
The code at the top of the page shows

<faces-config>
..
</faces-config>

this should be

<webapp>
..
</webapp>

Anonymous   
Printed
Page 245
second paragraph, second line

"The addLeafNode() method loops ..." should be "The addLeafNodes()
method loops ..."

Anonymous   
Printed
Page 251
second paragraph, fourth line

"because the JSP component actions are ..." should be "because the
JSF component actions are ..."

Anonymous   
Printed
Page 251
Code Example (continued)

int first = data.getFirst();
int rows = data.getRows();
for (int i = first, n = 0; n < rows; i++, n++)
...

should be

int first = data.getFirst();
int rows = data.getRows();
for (int i = first, n = 0; rows == 0 || n < rows; i++, n++) {
...

Anonymous   
Printed
Page 260
last paragraph, last line

"The Page class is an inner class" should be "The Page class is a
nested class"

Anonymous   
Printed
Page 276
second paragraph, starting with "All in all, ..."

This paragraph should be replaced with:

"All in all, we need to develop a custom renderer for the outer
table, a custom component for the tab control label (which uses
a standard renderer), and custom actions for both component/renderer
combinations. We must also register the custom component and the
custom renderer."

Anonymous   
Printed
Page 279
second paragraph, third line

"the currently selected tag has ..." should be "the currently selected
tab has ..."

Anonymous   
Printed
Page 308
ninth statement in the code snippet

grid.getAttributes().put("columns", "2");
should be
grid.getAttributes().put("columns", Integer.valueOf("2"));


Anonymous   
Printed
Page 314
renderResponse code sample

else {
Iterator i = component.getChildren().iterator();
while (i.hasNext()) {
renderView(context, (UIComponent) i.next(), state);
}
}

should read:

else {
Iterator i = component.getChildren().iterator();
while (i.hasNext()) {
renderResponse(context, (UIComponent) i.next());
}
}



Anonymous   
Printed
Page 318
last paragraph, second line

"defined by the combination of a view specification class and ..."
should be "defined by the combination of a view specification file and ..."

Anonymous   
Printed
Page 334, 335
<h:commandButton> and <h:commandLink> Attributes tables

For both these actions, the Description column for the "action"
attribute should be extended with this text: ", or a static String
value to be used as a hardcoded action outcome"

Anonymous   
Printed
Page 348 - 352
<h:outputFormat>, <h:outputLabel>, <h:outputLink>,

<h:outptText> Attributes tables

The EL-expression type column should say "Any" for the "value"
attribute row for all these actions.

Anonymous   
Printed
Page 428
SelectItemGroup constructors

The names for the last two constructors should be SelectItemGroup
instead of SelectItem.

Anonymous   
Printed
Page 430
Second paragraph

"a component with the rendered property set to true isn't rendered"
should be "a component with the rendered property set to false isn't
rendered"

Anonymous   
Printed
Page 432
First paragraph

"can be specified by the first and row attributes" should be "can be
specified by the first and rows component properties"

Anonymous   
Printed
Page 482
getActionListener() description

"Returns an instance of the default ActionListener instance used for
ActionSource ..." should be "Returns an instance of the default
ActionListener used for ActionSource ..."

Anonymous   
Printed
Page 489
renderView() description

It's duplicated. One copy should be removed.

Anonymous   
Printed
Page 496
writeText() description

A parameter is missing in the signature. It should look like this:

public abstract void writeText(Object text, java.lang.String property)
throws java.io.IOException

Anonymous   
Printed
Page 496
writeText() description

"The property name may be used to associate the attribute with ..."
should be "The property name may be used to associate the text with ..."

Anonymous   
Printed
Page 496
writeText() , the description NOW READS

public abstract void writeText(Object text, java.lang.String property)
throws java.io.IOException

Anonymous    Aug 01, 2004
Printed
Page 510
getValue(Object base, Object property) description

"while getting the type" should be "while getting the value"

Anonymous   
Printed
Page 511
isReadOnly(Object base, int index) description

"while getting the value" should be "while checking the writeability"

Anonymous   
Printed
Page 511
isReadOnly(Object base, Object property)

"while getting the type" should be "while checking the writeability"

Anonymous   
Printed
Page 511
setValue(Object base, int index, Object value)

"while getting the value" should be "while setting the value"

Anonymous   
Printed
Page 511
setValue(Object base, Object property, Object value)

"while getting the type" should be "while setting the value"

Anonymous   
Printed
Page 512
getExpressionString() description

"Returns the method binding expression ..." should be "Returns the
value binding ..."

Anonymous   
Printed
Page 518
ValueChangeListener description

"This interface is implemented by all classes interested in handling
ActionEvent events"

NOW READS:
"This interface is implemented by all
classes interested in handling ValueChangeEvent events"

Anonymous    Aug 01, 2004
Printed
Page 518
ValueChangeListener method signature and description NOW READS

public void processValueChange(javax.faces.event.ValueChangeEvent event)

Processes the event.

Anonymous    Aug 01, 2004
Printed
Page 520
createResponseStream() signature

The parameter name is missing. It should be:

public abstract javax.faces.context.ResponseStream
createResponseStream(java.io.OutputStream out)

Anonymous   
Printed
Page 520
createResponseWriter() signature

The first parameter name is missing. It should be:

public abstract javax.faces.context.ResponseWriter
createResponseWriter(java.io.Writer writer, String contentTypeList,
String characterEncoding)

Anonymous   
Printed
Page 525
getMaximum() and getMinimum() parameter types

public int getMaximum()

NOW READS:
public long getMaximum()

and
public int getMinimum()

NOW READS:
public long getMinimum()

Anonymous    Aug 01, 2004
Printed
Page 525
setMaximum() and setMinimum() return types

public void setMaximum(int maximum)

NOW READS:
public void setMaximum(long maximum)

and
public void setMinimum(int minimum)

NOW READS:
public void setMinimum(long minimum)

Anonymous    Aug 01, 2004
Printed
Page 533
createValidator() description

"instance of the converter identified ... " should be "instance of the
validator identified ..."

Anonymous   
Printed
Page 539
<state-manager> example snippet

Copy/paste error. It should be:

<state-manager>
com.mycompany.jsf.MyStateManager
</state-manager>

Anonymous