Reading Notes for Chapter 11, Head First Servlets and JSP
Table of Contents
569 |
Deploying your web app |
586 |
Servlet mappings can be "fake" |
599 |
The LOCAL and REMOTE tags are inconsistent |
570 |
Objectives |
587a |
Be the Container: DD servlet mappings |
600 |
Memorizing the JNDI <env-entry> DD tag |
571 |
The Joy of Deployment |
587b |
Key rules about servlet mappings |
601 |
Memorizing the <mime-mapping> DD tag |
572 |
What goes where in a web app |
588 |
BE the Container: Answers (from p. 587a) |
602 |
Sharpen your pencil: Where things go |
573 |
Sharpen your pencil: Name the directories |
589a |
Subtle issues |
603 |
Sharpen your pencil: Memorizing DD tags |
574 |
Sharpen your pencil: Draw the directory and file structure |
589b |
BE the Container (Which servlet will the Container choose?) (Answers at bottom of page 588). |
604 |
Sharpen your pencil ANSWERS: (from p. 602) |
575 |
Be the Container: What's wrong with this deployment? |
590 |
Configuring welcome files in the DD |
605 |
Sharpen your pencil ANSWERS: (from p. 603) |
576 |
Sharpen your pencil ANSWERS (from p. 573) |
591 |
Be the Container: Which welcome files? |
606 |
Coffee Cram Q1, Q2, Q3 |
577 |
Sharpen your pencil ANSWERS (from p. 574) |
592 |
Be the Container ANSWERS (from p. 591) |
607 |
Coffee Cram Q4, Q5, Q6 |
578 |
Be the Container: ANSWERS (from p. 575) |
593 |
How the Container chooses a welcome file |
608 |
Coffee Cram Q7, Q8, Q9 |
579 |
What she really wants is a WAR file |
594a |
Configuring error pages in the DD |
609 |
Coffee Cram Q10, Q11 |
580 |
WAR files |
594b |
You can't use <error-code> and <exception-type> together. |
610 |
Coffee Cram Q12, Q13, Q14 |
581 |
What a deployed WAR file looks like |
595a |
There are no Dumb Questions (about error handling) |
611 |
Coffee Cram Answers Q1, Q2, Q3 |
582 |
Making static content and JSPs directly accessible |
595b |
You must use the fully-qualified class name in <exception-type>! |
612 |
Coffee Cram Answers Q4, Q5, Q6 |
583 |
There are no dumb questions (about WEB-INF and META-INF) |
596 |
Configuring servlet initialization in the DD |
613 |
Coffee Cram Answers Q7, Q8, Q9 |
584 |
How servlet mapping REALLY works |
597 |
Making an XML-compliant JSP: a JSP Document |
614 |
Coffee Cram Answers Q10, Q11 |
585 |
The ACTUAL directory structure vs. the VIRTUAL directory structure |
598 |
Memorizing the EJB-related DD tags |
615 |
Coffee Cram Answers Q12, Q13, Q14 |
p569 Deploying your web app
This chapter is all about "what goes where" in a web app. Look back at p. 73 for a moment—remember the first time you saw this big hairy directory tree? Well, by now it should be "old hat". This chapter explores that tree in all its gory detail.
Read over the intro to the chapter on p. 569 so you'll have an overview of what is coming.
p570 Objectives
Objectives 2.1, 2.2, 2.3 and 2.4 are important for CISC474 as well, so spend a moment to look over them, plus the coverage notes.
On the other hand, objective 6.3 (about XML syntax for JSPs) is something that is only in the book because its on the SCWCDE exam—and even the book covers the "bare minimum so you can pass the exam" on this topic. So, don't worry about it so much for CISC474. This also means that when you get to p. 597, you can start skipping a bit. (I'll remind you when we get there.)
p571 The Joy of Deployment
Three main issues to think about in this chapter
- Where do YOU put things in the web app
- Where will the CONTAINER look for things in the web app
- How does the CLIENT request things in the web app
Read p. 571 and clarify these three issues in your mind before moving on.
One other issue: which parts of the whole directory tree can the client "reach down into and grab things out of directly", and which parts are "protected" (i.e. the client CANNOT get access to them directly?
p572 What goes where in a web app
As it turns out, Chapter 11 assumes you've already read Chapters 1-10. The nerve!
Here is a list of some pages that you might find it especially helpful to review at this point. I'm not guaranteeing this is a complete list. I would welcome suggestions for additional pages for this list (for journaling points.)
- the basic directory structure—Chapter 3 (hands-on MVC), p. 73
- static HTML file
- classes
- the web.xml file (deployment descriptor)
- more on the basics
- Chapter 5 (attributes and listeners), p. 176
- where JSPs go
- Chapter 3 (hands-on MVC), p. 73
- Chapter 7 (using JSP), p. 283
- where TLDs go
- Chapter 8 (Scriptless JSP), p. 390
- Chapter 9 (Using JSTL), p.476
- Chapter 10 (custom tag development), p. 499
- where .tag files go
- Chapter 10 (custom tag development), p. 492,
- Chapter 10 (custom tag development), p. 499
- class files for a tag handler
- Chapter 10 (custom tag development), p. 503
- files you want to serve up via "getResourceAsStream("/filename");—Chapter 4 (request and response), p. 129.
p573 Sharpen your pencil: Name the directories
The answer to this exercise is on p. 576. You really should try it before moving on. I did, and I found I needed to go back and review. Note my helpful list of pages to review in the reading notes for p. 572—you might find it useful.
p574 Sharpen your pencil: Draw the directory and file structure
@@@
p575 Be the Container: What's wrong with this deployment?
@@@
p576 Sharpen your pencil ANSWERS (from p. 573)
@@@
p577 Sharpen your pencil ANSWERS (from p. 574)
@@@
p578 Be the Container: ANSWERS (from p. 575)
@@@
p579 What she really wants is a WAR file
@@@
p580 WAR files
@@@
p581 What a deployed WAR file looks like
@@@
p582 Making static content and JSPs directly accessible
@@@
p583 There are no dumb questions (about WEB-INF and META-INF)
@@@
p584 How servlet mapping REALLY works
@@@
p585 The ACTUAL directory structure vs. the VIRTUAL directory structure
@@@
p586 Servlet mappings can be "fake"
@@@
p587a Be the Container: DD servlet mappings
@@@
p587b Key rules about servlet mappings
@@@
p588 BE the Container: Answers (from p. 587a)
@@@
p589a Subtle issues
@@@
p589b BE the Container (Which servlet will the Container choose?) (Answers at bottom of page 588).
@@@
p590 Configuring welcome files in the DD
@@@
p591 Be the Container: Which welcome files?
@@@
p592 Be the Container ANSWERS (from p. 591)
@@@
p593 How the Container chooses a welcome file
@@@
p594a Configuring error pages in the DD
@@@
p594b You can't use <error-code> and <exception-type> together.
@@@
p595a There are no Dumb Questions (about error handling)
@@@
p595b You must use the fully-qualified class name in <exception-type>!
@@@
p596 Configuring servlet initialization in the DD
Check both the confirmed errata and the unconfirmed errata for this page!
@@@
p597 Making an XML-compliant JSP: a JSP Document
@@@
p598 Memorizing the EJB-related DD tags
@@@
p599 The LOCAL and REMOTE tags are inconsistent
@@@
p600 Memorizing the JNDI <env-entry> DD tag
@@@
p601 Memorizing the <mime-mapping> DD tag
@@@
p602 Sharpen your pencil: Where things go
@@@
p603 Sharpen your pencil: Memorizing DD tags
@@@
p604 Sharpen your pencil ANSWERS: (from p. 602)
Check the unconfirmed errata for this page!
@@@
p605 Sharpen your pencil ANSWERS: (from p. 603)
@@@
p606 Coffee Cram Q1, Q2, Q3
@@@
p607 Coffee Cram Q4, Q5, Q6
@@@
p608 Coffee Cram Q7, Q8, Q9
Check the confirmed errata for this page!
@@@
p609 Coffee Cram Q10, Q11
@@@
p610 Coffee Cram Q12, Q13, Q14
@@@
p611 Coffee Cram Answers Q1, Q2, Q3
@@@
p612 Coffee Cram Answers Q4, Q5, Q6
@@@
p613 Coffee Cram Answers Q7, Q8, Q9
@@@
p614 Coffee Cram Answers Q10, Q11
@@@
p615 Coffee Cram Answers Q12, Q13, Q14
@@@
End of CISC474 reading notes for HFSJ, Chapter 11