The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Dimitri (2) [Avatar] Offline
#1
To whom it may concern,

I would kindly draw your attention to a small error: question number 3 lists two possible answers, c and d, that are the same and above all both correct, that is:
c. FilterThree, FilterTwo
d. FilterThree, FilterTwo

The same is true for the 'Appendix C Review Q & A' regarding the aforementioned question; the explanation hints at the answers as they were meant, that is:
c. FilterTwo, FilterThree
d. FilterThree, FilterTwo

Yours faithfully


Message was edited by: Dimitri
mikec (11) [Avatar] Offline
#2
Re: Errata - Chapter 7.6 Review Questions - too many correct answers
confirmed!

Thanks for the report.

-------------------------------------------------------------------------
Mike Curwen
SCWCD Exam Kit 2nd Edition Technical Reviewer
-------------------------------------------------------------------------
Kjeld (26) [Avatar] Offline
#3
Re: Errata - Chapter 7.6 Review Questions - too many correct answers
I really can't tell why FilterTwo would apply, it is mapped to a url pattern that does not match the given URI.
Even if it would apply for some reason, would the order not be FilterTwo, FilterThree? Meaning answer c in the correction hereabove?
tempusfugit (144) [Avatar] Offline
#4
Re: Errata - Chapter 7.6 Review Questions - too many correct answers
Review 7.3.3 Configuring a filter chain

"finds ALL the filter mappings with a URL pattern that matches the request URI"

"the order of the filters is the order in which they appear in the deployment descriptor."


The request URI is
/admin/index.jsp

This matches the url patterns (through the implied REQUEST dispatcher) of

<filter-mapping>
<filter-name>FilterThree</filter-name>
<url-pattern>/admin/*</url-pattern>
</filter-mapping>

AND

<filter-mapping>
<filter-name>FilterTwo</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

and this is also the order in which they appear in the deployment descriptor - so the execution order is

FilterThree, FilterTwo
Kjeld (26) [Avatar] Offline
#5
Re: Errata - Chapter 7.6 Review Questions - too many correct answers
But, the book I have here declares FilterTwo as:

<filter-mapping>
<filter-name>FilterTwo</filter-name>
<url-pattern>/users/*</url-pattern>
</filter-mapping>

So the URL pattern is not /* according to my book. Hence I believed FilterTwo would not comply.

I copied the web.xml snipplet hereabove exactly from the book. It's at page 118 (7.6 Review Question 3) and 425 (the answer to that question).
The ISBN number is 1-932394-38-9
tempusfugit (144) [Avatar] Offline
#6
Re: Errata - Chapter 7.6 Review Questions - too many correct answers
There are TWO url-patterns for FilterTwo. You are looking at the SECOND filter-mapping. The one (for FilterTwo) that applies is the FOURTH filter-mapping.
Kjeld (26) [Avatar] Offline
#7
Re: Errata - Chapter 7.6 Review Questions - too many correct answers
I see that now, completely missed it. Sorry for extending the topic unnecessarily.