Errata

Programming Jakarta Struts

Errata for Programming Jakarta Struts

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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

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

Version Location Description Submitted by Date submitted
Printed Page 30
example 2-2

The result.jsp file is missing from the source.zip file in the examples download
section of the web site for this book.

The readme file directs the reader to this zip file.
If this (and other .jsp) files are to be found elsewhere,
they should be documented as such in the readme file.

Anonymous   
Printed Page 89
bottom of page

Table 4-8 says that path must begin with a "/" character
but the example given has a path without that character,
namely, "viewsignin".

So, is the example wrong, or is the statement that slash
is required wrong??

Anonymous   
Printed Page 89
Table 4-8, paragraph for "path" attribute

The final sentence reads, "This attribute is required and must begin with a '/'
character".

The following example of a "global-forwards" element contains a child "forward"
element with a path that violates this statement.

Anonymous   
Printed Page 89
Table 4-8

In the row about the contextRelative attribute,

"Set to true to indicate that the resource specified in the path attribute should be
interpreted as application-relative if the path starts with a "/" character."

should read

"Set to true to indicate that the resource specified in the path attribute should be
interpreted as context-relative if the path starts with a "/" character."

Anonymous   
Printed Page 91
Table 4-9

In Table 4-9 under the entry for input, you claim that input is required "if the name
attribute is specified"; however, your struts-config.xml file for the banking example
has several entries with name but without input (e.g., /getaccountinformation).

Anonymous   
Printed Page 97
<action path="/signoff" section

The element
<action
path="/signoff"
type="com.oreilly.struts.storefront.security.LogoutAction"
scope="request"
validate="false"
input="/security/signin.jsp">

The scope, input and validate tags are extraneous.

It should be:

<action
path="/signoff"
type="com.oreilly.struts.storefront.security.LogoutAction">

Anonymous   
Printed Page 114
Example 5-4 code block

Towards the end of the processLocale method is the code:

// If the Locale was never added to the session or it has changed, set it
if (sessionLocale == null || (sessionLocale != requestLocale) ){
// Set the new Locale into the user's session
session.setAttribute( Action.LOCALE_KEY, requestLocale );
}

The test condition always evaluates to true because sessionLocale != requestLocale is
always true since you are comparing reference equivalency and not object equivalency.
Therefore the user's locale is being set with each request.

Therefore:
if (sessionLocale == null || (sessionLocale != requestLocale) )
should be changed to:
if ( sessionLocale == null || (!sessionLocale.equals(requestLocale)) )

Anonymous   
Printed Page 123
2nd paragraph

The sample struts-config.xml <action> tag for using a ForwardAction shows the
<action> tag with two closing tags:
<action ... />
</action>

Anonymous   
Printed Page 149
Figure 6-4

The entity relationship diagram shows the CATALOGITEM_LNK table has a primary key on
the id column. This table has no id column.

Anonymous   
Printed Page 151
PURCHASE ORDER DDL

The footnote claims that the DDL has been tested on Oracle 8.1.7 however the DDL
creates a table with a column type of timestamp. There is no datatype timestamp in
oracle and a date type should be used instead. This should probably be added to the
footnote.

Anonymous   
Printed Page 167
getSessionObject method

The comment
// Don't create a session if one isn't already present

does not match the call:
HttpSession session = req.getSession(true);

Anonymous   
Printed Page 200
End of 'Accessing Nested Properties' paragraph

For the setter property:

property="user.address.city"

the corresponding setter java methods will be:

setUser().setAddress().setCity(value)

Anonymous   
Printed Page 222
Code example

The Class ApplicationConfig is no longer called present, it has been renamed to
ModuleConfig. The error occurs in many other places in the book.

Anonymous   
Printed Page 260, 261
various locations

all references to validation-rules.xml should be validator-rules.xml

Also, it appears as thogh the 1.1 DTD has been deprecated and they are reverting back
to 1.0.

Anonymous   
Printed Page 266
bottom of the page

The line which reads:
<!ELEMENT field (msg?, arg0?, arg1?, arg2?, arg3?, var*)>
should read:
<!ELEMENT field (msg | arg0 | arg1 | arg2 | arg3 | var)*>
The replacement line is sourced from:
http://9780596003289.apache.org/commons/dtds/validator_1_0.dtd
which is what Struts 1.1 uses.

Anonymous   
Printed Page 272
XML example

Opening <form-validation> tag is omitted

Anonymous   
Printed Page 329
example 14.2 3rd taglib line

The struts tablib delivered in 9780596003289-struts-1.1-b3 is in
struts-tiles.tld, not tiles.tld

Hence the line should read
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

Anonymous   
Printed Page 345
end of 1st paragraph after example 14-7

READS:

"... content, the sign-body.jsp file."
SHOULD BE:
"... content, the signin-body.jsp file."

Anonymous   
Printed Page 345
2nd paragraph

Declaring Definitions in a Configuation File

We can specify definitions in a jsp page or an XML file.
The error encounters when u specify defintions in XML file.

Its mentioned in the book that once u specify definition in XML file, the only change
u required to do in jsp page vis-a-vis specifying definitions in jsp page, is
"include directive is not required".

I have found out that one more change is required in the jsp file and that is :

instead of

<tiles:insert beanName="storefront.default" beanScope="request">
<tiles:put name="body-content" value="../security/signin-body.jsp"/>
</tiles:insert>

it should be:

<tiles:insert definition="storefront.default">
<tiles:put name="body-content" value="/index.jsp"/>
</tiles:insert>

Anonymous