Head First Servlets & Jsp

by
Format: Paperback
Pub. Date: 2004-09-01
Publisher(s): Oreilly & Associates Inc
List Price: $44.95

Rent Book

Select for Price
There was a problem. Please try again later.

Digital

Rent Digital Options
Online:1825 Days access
Downloadable:Lifetime Access
$37.19
*To support the delivery of the digital material to you, a non-refundable digital delivery fee of $3.99 will be charged on each digital item.
$37.19*

New Book

We're Sorry
Sold Out

Used Book

We're Sorry
Sold Out

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

Summary

Imagine a world without eBay...unthinkable! How would you get that Farrah Fawcett poster, retired Beanie Baby, or first-edition pet rock? Handling over a gazillion (OK, we exaggerate--it's actually only 1 billion) page views each day, server-side Java makes eBay work. Isn't it time you learned the latest (J2EE 1.4) versions of Servlets & JSPs? This book will get you way up to speed on the technology you'll know it so well, in fact, that you can pass the Sun Certified Web Component Developer (SCWCD) 1.4 exam. If that's what you want to do, that is. Maybe you don't care about the exam, but need to use Servlets & JSPs in your next project. You're working on a deadline. You're over the legal limit for caffeine. You can't waste your time with a book that makes sense only AFTER you're an expert (or worse one that puts you to sleep). No problem.Head First Servlets and JSP'sbrain-friendly approach drives the knowledge straight into your head (without sharp instruments). You'll interact with servlets and JSPs in ways that help you learn quickly and deeply. It may not beThe Da Vinci Code, but quickly see why so many reviewers call it "a page turner". Most importantly, this book will help you use what you learn. It won't get you through the exam only to have you forget everything the next day. Learn to write servlets and JSPs, what makes the Container tick (and what ticks it off), how to use the new JSP Expression Language (EL), what you should NOT write in a JSP, how to write deployment descriptors, secure applications, and even use some server-side design patterns. Can't talk about Struts at a cocktail party? That'll change. You won't just pass the exam, you will truly understand this stuff, and you'll be able to put it to work right away. This new exam is tough--much tougher than the previous version of the SCWCD. The authors ofHead First Servlets and JSPknow: they created it. (Not that it EVER occurred to them that if they made the exam really hard you'd have to buy a study guide to pass it.) The least they could do is give you a stimulating, fun way to pass the thing. If you're one of the thousands who usedHead First EJBto pass the SCWCD exam, you know what to expect!

Table of Contents

Intro xix
Your brain on Servlets
Who is this book for? xx
We know what your brain is thinking xxi
Metacognition xxiii
Bend your brain into submission xxv
What you need for this book xxvi
Passing the certification exam xxviii
Technical reviewers xxx
Acknowledgements xxxi
Why use servlets & JSPs?
1(36)
Web applications are hot
Exam Objectives
2(2)
What web servers and clients do, and how they talk
4(3)
Two-minute guide to HTML
7(3)
What is the HTTP protocol?
10(5)
Anatomy of HTTP Get and Post requests and HTTP responses
15(5)
Locating web pages using URLs
20(4)
Web servers, static web pages, and CGI
24(6)
Servlets Demystified: write, deploy, and run a servlet
30(4)
JSP is what happened when somebody introduced Java to HTML
34(3)
Web app architecture
37(30)
Servlets need help
Exam Objectives
38(1)
What is a Container and what does it give you?
39(5)
How it looks in code (what makes a servlet a servlet)
44(2)
Naming servlets and mapping them to URLs using the DD
46(4)
Story: Bob Builds a Matchmaking Site (an MVC intro)
50(4)
A Model-View-Controller (MVC) overview and example
54(10)
A ``working'' Deployment Descriptor (DD)
64(1)
How J2EE fits into all this
65(2)
Mini MVC tutorial
67(26)
Create and deploy an MVC web app
Exam Objectives
68(1)
Let's build an MVC application; first the design
69(3)
Create the development and deployment environments
72(3)
Create and test the HTML for the initial form page
75(2)
Create the Deployment Descriptor (DD)
77(3)
Create, compile, depoly, and test the controller servlet
80(2)
Design, build, and test the model component
82(1)
Enhance the controller to call the model
83(4)
Create and deploy the view component; (it's a JSP)
87(1)
Enhance the controller servlet to call the JSP
88(5)
Being a servlet
93(54)
Servlets live to service clients
Exam Objectives
94(1)
A servlet's life in the Container
95(6)
Servlet initialization and threads
101(4)
A servlet's Real job is to handle Get and Post requests
105(7)
The story of the non-idempotent request
112(5)
What determines whether you get a Get or Post request?
117(2)
Sending and using parameter(s)
119(7)
So that's the Request... now let's see the Response
126(7)
You can set response headers, you can add response headers
133(3)
Servlet redirect vs. request dispatcher
136(4)
Review: HttpServletResponse
140(7)
Being a web app
147(74)
No servlet stands alone
Exam Objectives
148(1)
Init Parameters and ServletConfig to the rescue
149(6)
How can a JSP get servlet init parameters?
155(2)
Context init parameters to the rescue
157(2)
Comparing ServletConfig and ServletContext
159(5)
She wants a ServletContextListener
164(4)
Tutorial: write a simple ServletContextListener
168(8)
Compile, deploy, and test your listener
176(2)
The full story, a ServletContext Listener review
178(2)
Eight Listeners: they're not just for context events...
180(5)
What, exactly, is an attribute, and what are its scopes?
185(4)
The Attribute API and the dark side of attributes...
189(2)
Context scope isn't thread-safe!
191(3)
How do we make context attributes thread-safe?
194(1)
Trying out Synchronization
195(3)
Are Session attributes thread-safe?
198(3)
The evils of Single ThreadModel
201(1)
Only Request attributes and local variables are thread-safe!
202(1)
Request attributes and Request dispatching
203(18)
Conversational state
221(58)
Web servers have no short-term memory
Exam Objectives
222(2)
It's supposed to be a conversation, (how sessions work)
224(5)
Session IDs, cookies, and other session basics
229(5)
URL rewriting: something to fall back on
234(5)
When sessions get stale; getting rid of bad sessions
239(9)
Can I use cookies for other things besides sessions?
248(4)
Key milestones for an HttpSession
252(2)
Don't forget about HttpSessionBindingListener
254(1)
Session migration
255(4)
Listener examples
259(20)
Being a JSP
279(62)
A JSP becomes a servlet
Exam objectives
280(1)
Create a simple JSP using ``out'' and a page directive
281(5)
JSP expressions, variables, and declarations
286(8)
Time to see a JSP-generated servlet
294(2)
The out variable isn't the only implicit object...
296(8)
The Lifecycle and initialization of a JSP
304(8)
While we're on the subject... the three directives
312(3)
Scriptlets considered harmful? Here's EL
315(6)
But wait... we haven't seen: actions
321(20)
Script-free pages
341(92)
Lose the scripting
Exam objectives
342(1)
When attributes are beans
343(3)
Standard actions: useBean, getProperty, setProperty
346(6)
Can you make polymorphic bean references?
352(6)
The param attribute to the rescue
358(3)
Converting properties
361(5)
Expression Language (EL) saves the day!
366(2)
Using the dot (.) operator to access properties and map values
368(1)
The [ ] gives you more options (Lists, arrays...)
369(5)
More dot and [ ] operator details
374(7)
The EL implicit objects
381(6)
EL functions, and handling ``null''
387(11)
Reusable template pieces---two kinds of ``include''
398(11)
The <jsp:forward> standard action
409(4)
She doesn't know about JSTL tags (a preview)
413(1)
Reviewing standard actions and include
414(19)
Custom tags are powerful
433(56)
Sometimes you need more than EL or standard actions
Exam objectives
434(2)
Looping without scripting; <c:forEach>
436(5)
Conditional control with <c:if> and <c:choose>
441(4)
Using the <c:set> and <c:remove> tags
445(5)
With <c:import>, there are three ways to include content
450(2)
Customizing the thing you include
452(1)
Doing the same thing with <c:param>
453(2)
<c:url> for all your hyperlink needs
455(3)
Make your own error pages
458(4)
The <c:catch> tag. Like try/catch...sort of
462(3)
What if you need a tag that's Not in JSTL?
465(5)
Pay attention to <rtexprvalue>
470(2)
What can be in a tag body
472(1)
The tag handler, the TLD, and the JSP
473(1)
The taglib <uri> is just a name, not a location
474(3)
When a JSP uses more than one tag library
477(12)
When even JSTL isn't enough...
489(80)
Sometimes JSTL and standard actions aren't enough
Exam objectives
490(2)
Tag Files: like include, only better
492(7)
Where the Container looks for Tag Files
499(3)
Simple tag handlers
502(7)
What if the tag body uses an expression?
509(10)
You still have to know about Classic tag handlers
519(1)
Tag handler API
520(1)
A very small Classic tag handler
521(5)
The Classic lifecycle depends on return values
526(1)
Iteration Tag lets you repeat the body
527(2)
Default return values from TagSupport
529(4)
With BodyTag, you get two new methods
533(4)
What if you have tags that work together?
537(10)
Using the PageContext API for tag handlers
547(22)
Deploying your web app
569(48)
Finally, your web app is ready for prime time
Exam objectives
570(1)
Key deployment task, what goes where?
571(8)
WAR files
579(5)
How servlet mapping Really works
584(6)
Configuring welcome files in the DD
590(4)
Configuring error pages in the DD
594(2)
Configuring servlet initialization in the DD
596(1)
Making an XML-compliant JSP: a JSP Document
597(20)
Keep it secret, keep it safe
617(52)
Your web app is in danger
Exam objectives
618(3)
The Big 4 in servlet security
621(3)
How to Authenticate in HTTP World
624(3)
Top Ten Reasons to do your security declaratively
627(1)
Who implements security in a web app?
628(3)
Authorization: roles and constraints
631(14)
Authentication: four flavors
645(1)
The Four authentication types
645(4)
Securing data in transit: HTTPS to the rescue
649(3)
Data confidentiality and integrity sparingly and declaratively
652(17)
The power of filters
669(36)
Filters let you intercept the request
Exam objectives
670(5)
Building a request tracking filter
675(1)
A filter's life cycle
676(2)
Declaring and ordering filters
678(3)
Compressing output with a response-side filter
681(6)
Wrappers rock
687(3)
The real compression filter code
690(2)
Compression wrapper code
692(13)
Enterprise design patterns
705(132)
Someone has done this already
Exam objectives
706(1)
Hardware and software forces behind patterns
707(4)
Review of software design principles...
711(2)
Patterns to support remote model components
713(2)
Overview of JNDI and RMI
715(5)
The Business Delegate is a ``go-between''
720(2)
Simplify your Business Delegates with the Service Locator
722(4)
Time for a Transfer Object?
726(4)
Our very first pattern revisited... MVC
730(5)
Yes! It's Struts (and Front Controller), in a nutshell
735(3)
Refactoring the Beer app for Struts
738(8)
Review of patterns
746(13)
Appendix A: COFFEE CRAM
The final Coffee Cram Mock Exam
Final mock exam
759(39)
Answers
798(39)
Index 837

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.