341 |
Script-free pages |
373 |
(p. 372 continued) |
404 |
The <jsp:include> standard action at first request |
342 |
Objectives |
374 |
For beans and Maps you can use either operator |
405a |
The attribute names are different for the include directive and <jsp:include> |
343 |
Our MVC app depends on attributes |
375 |
If it's NOT a String literal, it's evaluated |
405b |
The include directive is position-sensitive! |
344 |
But what if the attribute is not a String, but an instance of Person? |
376 |
You can use nested expressions inside the brackets |
405c |
Q and A |
345 |
We need more code to get the Person's name |
377 |
You can't do ${foo.1} |
406 |
"You've got nested HTML and BODY tags!" Uh-oh. She's right. |
346 |
Person is a JavaBean, so we'll use the bean-related standard actions |
378 |
Code Magnets (EL) |
407 |
The way we SHOULD have done it |
347 |
Deconstructing <jsp:useBean> and <jsp:getProperty> |
379 |
(p. 378 continued) |
408 |
Customizing the included content with <jsp:param> |
348 |
<jsp:useBean> can also CREATE a bean; |
380 |
Code Magnets Answers (p. 378-379) |
409 |
The <jsp:forward> standard action |
349 |
You can use <jsp:setProperty> |
381 |
The EL implicit objects |
410 |
A conditional forward |
350 |
<jsp:useBean> can have a body! |
382 |
Request parameters in EL |
411 |
How it runs... |
351 |
Generated servlet when <jsp:useBean> has a body |
383 |
What if you want more information from the request? |
412 |
With <jsp:forward>, the buffer is cleared BEFORE the forward |
352 |
Can you make polymorphic bean references? |
384 |
The requestScope is NOT the request object |
413 |
She doesn't know about JSTL tags |
353 |
Adding a type attribute to <jsp:useBean> |
385 |
Scope implicit objects can save you |
414 |
Bean-related standard action review |
354 |
Using type without class |
386 |
Getting Cookies and init params |
415 |
The include review |
355 |
The scope attribute defaults to "page" |
387 |
She doesn't know about EL functions |
416 |
Be the Container ANSWERS (from p. 356) |
356 |
Be the Container: (standard actions, JSPs, and servlets) |
388 |
Imagine you want your JSP to roll dice |
417 |
Coffee Cram Q1, Q2 |
357 |
Going straight from the request to the JSP without going through a servlet |
389 |
The function class, the TLD, and the JSP |
418 |
Coffee Cram Q3 |
358 |
The param attribute to the rescue |
390 |
Deploying an app with static functions |
419 |
Coffee Cram Q4, Q5 |
359 |
But wait! It gets even better... |
391a |
There are no dumb questions |
420 |
Coffee Cram Q6, Q7 |
360 |
If you can stand it, it gets even BETTER... |
391b |
The METHOD name is not the same as the FUNCTION name |
421 |
Coffee Cram Q8, Q9, Q10 |
361 |
Bean tags convert primitive properties automatically |
392 |
And a few other EL operators |
422 |
Coffee Cram Q11, Q12, Q13 |
362 |
There are no dumb questions |
393 |
Sharpen your pencil (EL) |
423 |
Coffee Cram Q14, Q15 |
363 |
The bean standard action tags are more natural to a non-programmer |
394 |
Sharpen your pencil answers (from p. 393) |
424 |
Coffee Cram Q16, Q17, Q18 |
364 |
But what if the property is something OTHER than a String or a primitive |
395 |
EL handles null values gracefully |
425 |
Coffee Cram Answers Q1, Q2 |
365 |
Trying to display the property of the property |
396 |
JSP Expression Language (EL) review |
426 |
Coffee Cram Answers Q3 |
366 |
Expression Language (EL) saves the day! |
397 |
[Web designer thought bubbles] "Yeah, I haven't heard ONE thing about using layout templates." |
427 |
Coffee Cram Answers Q4, Q5 |
367 |
Deconstructing the JSP Expression Language (EL) |
398 |
Reusable template pieces |
428 |
Coffee Cram Answers Q6, Q7 |
368 |
Using the dot (.) operator to access properties and map values |
399 |
The include directive |
429 |
Coffee Cram Answers Q8, Q9, Q10 |
369 |
The [] operator is like the dot only way better |
400 |
The <jsp:include> standard action |
430 |
Coffee Cram Answers Q11, Q12, Q13 |
370 |
The [] gives you more options... |
401 |
They're NOT the same underneath |
431 |
Coffee Cram Answers Q14, Q15 |
371 |
Using the [] operator with an array |
402 |
The include directive happens at translation time
<jsp:include> happens at runtime |
432 |
Coffee Cram Answers Q16, Q17, Q18 |
372 |
A String index is coerced to an int for arrays and Lists |
403 |
The include directive at first request |
|
|