• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SCWCD Study Companion (2nd Edition) errata

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some typos and others from Charles Lyons' Sun Certified Web Component Developer Study Companion: SCWCD Java EE 5 2nd Edition (with Java EE 6 preview) book:

Chapter 1, page 15: After "A typical example ... data is:" the example
is missing.

Chapter 3, Question 12: The order in the question is correct.

Chapter 3, Question 13: Missing "?" at the end of the question.

Chapter 3, Question 4: I think C is correct. A: no such method in
GenericServlet., B, E: specified in interface ServletConfig, D:
Specified in interface Servlet.

Chapter 5, Question 5: You can change lineA and lineB, it also works on
Tomcat 6. (no flush, and just the character encoding is fix after
getWriter()).

Chapter 5, Question 6: B also correct. When the sendError exception
occur, the content already on the client.

Chapter 5, Question 7: C and D are the same.

Chapter 5, Queston 8: No space between the comma and "obtain":
"code,obtain".

Chapter 5, page 109, sendRedirect(): Tomcat sends 302, instead of 307.

Chapter 6, page 143, bottom of the page: "rd.include(myWrapper, req);" -
change "req" to "resp".

Chapter 6, Question 6: A's output: "FILE". The final "</div>" doesn't
appear on the output. (Tomcat 6)

Chapter 7, page 172: "wrp" vs "wrap" in the code block.

Chapter 7, Question 9, 10, 12: doFilter throws IOException,
ServletException is missing. So, these codes don't compile at all. I
saw this sort of type in other chapters too.

Chapter 8, Question 9, Question 11 exhibits: they don't compile, because
forward throw IOException, ServletException. It occurs previous chapters
too.

Chapter 8, Question 13: "HttpActivationListener" ->
"HttpSessionActivationListener "

Chapter 10, page 249, Expressions: the book sais: "If the contents
cannot be cast to a String..." Actually, "<%= new java.util.Date() %>"
works well. I think the container calls toString() method instead of
casting. (tested on Tomcat 6)

Chapter 10, question 12: The result with Tomcat 6 is compilation error:
Duplicate method _jspInit() in type q12_jsp.

Chapter 15, page 410: "Hence, you can always rely on instance or
static-class variables..." - static class?

Chapter 15, question 16: and doTag() doesn't catch invoke's exceptions.

Chapter 15, question 19: The correct answer is E. doTag() doesn't catch
invoke's exceptions.

Chapter 16, question 7: ${ session == null } writes true in a tag file.
I think B is correct.

Chapter 16, question 14: The book haven't metion before that JSP is a valid
value for body-content attribute. The first appear of JSP value is in
the chapter 17 (page 487).

Chapter 15, page 452: description are same for the two variable
declaration ("Entries for the partical date"). On page 458 also.

Chapter 17, question 7: In D you should omit the "mytag.tag" from the
value of tagdir attribute.

I got a question about DD's env-entry tag on the exam. It is gray on
page 205.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I got a question about DD's env-entry tag on the exam. It is gray on
page 205.



Yeah, I noticed this too and it bothered me a lot because it's such a simple thing for the book to get right, but a painful gap in knowledge for the test taker. I saw a question about the env-entry tag and one for ejb-ref, so I would tell people that basic questions on the EJB elements in the DD are fair game.
 
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've just visited this thread and decided to add what I've found.

Chapter 8, Question 10: I think E is correct instead of C [discussion]

Chapter 12, Question 18: I don't really know if there is a correct answer. More details here: [discussion]

Chapter 14, Question 17: I guess there is a typographical error, as the B and C answers shows "/catalogue/item/jsp" instead of "/catalogue/item.jsp". Therefore I don't think the answer B should be correct, as the question asks for the "/catalogue/item.jsp" file.
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess I've found another bug.

SCWCD Study Companion, pp. 439 - The tag directive wrote:tag is similar to page in that more than one tag directive may be declared, but only one occurence of any given attribute may be declared, unless each occurence of that attribute has the same value. The import and pageEncoding attributes are exceptions to this rule, and may appear multiple times.



I guess that multiple occurrences feature affects only the import attribute, as the pageEncoding still can be present only once, even if it has the same value as previously declared.
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The import and pageEncoding attributes are exceptions to this rule, and may appear multiple times.


I don't know the context of this phrase but the pageEncoding can appear more than once in a translation unit:

JSP.1.10.1 The page Directive
...
A translation unit (JSP source file and any files included via the include directive)
...
There shall be only one occurrence of any attribute/value pair defined by this directive in a given translation unit, unless the values for
the duplicate attributes are identical for all occurrences. The import and pageEncoding attributes are exempt from this rule and can appear multiple times.



Regards,
Frits
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy Frits!

Please, take a look at two sentences more from what you quoted:

JSP 2.2 Specification, JSP1.10.1 The page directive wrote:There shall be only one occurrence of any attribute/value pair defined by this directive in a given translation unit, unless the values for the duplicate attributes are identical for all occurrences. The import and pageEncoding attributes are exempt from this rule and can appear multiple times. Multiple uses of the import attribute are cumulative (with ordered set union semantics). The pageEncoding attribute can occur at most once per file (or a translation error will result), and applies only to the file in which it appears.



I dare to say that either I don't understand the sentence in the specification, or the text red-coloured is misleading and... wrong.

As I understand it - the import and pageEncoding are exempts from the multiple-occurrences rule, but not in the same way.

Import is cumulative (which means that can break the rule and appear more than once with different values) where the pageEncoding can appear only once (which means that can break the rule and can't appear even if it introduces the same value).

What do you think about it Frits?

EDIT: the exact title of the specification I quoted: JavaServer PagesTM Specification Version 2.2, Maintenace Release 2
 
Frits Walraven
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

As I understand it - the import and pageEncoding are exempts from the multiple-occurrences rule, but not in the same way.


Correct.

Import is cumulative (which means that can break the rule and appear more than once with different values)


Correct, it can appear more than once in a file and more than once in the translation unit (A translation unit :JSP source file and any files included via the include directive) and it can have different values.

where the pageEncoding can appear only once


Once per file, but more than once in a translation unit (that is the key thing to grasp here). The pageEncoding's in the different file's of a translation unit can however be different.

Does this now clear your doubts?

Regards,
Frits
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Frits!

So, to sum this up:

This does not work (different values of the same attribute in a file):

This does not work (the same values of the same attribute in a file, but the pageEncoding is an exception from the rule):

This does work (different values of the same attribute in a translation unit is acceptable for the pageEncoding):


EDIT: Maybe this discussion (about pageEncoding and tag directive) could be moved into the separate thread to keep this one clean and only errata-related and make it easy for other people to find solution about the page and tag directives?
 
Piotr Nowicki
Ranch Hand
Posts: 623
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Chapter 18, Question 16

I guess in the source code there is a missing "!", as the so presented code cannot be filled with any presented code fragments to fulfill the task


Chapter 18, Question 17 the exhibit DD code looks like this: (only relevant parts are left)



This code is missing the obligatory element <web-resource-name> inside <web-resource-collection> which even on page 519 is tagged as "1" so it must be present.
 
reply
    Bookmark Topic Watch Topic
  • New Topic