Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head first servlets and jsp book

 
Suneel Siwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Respected Programmers,

I am studying head first servlets and jsp new book.
on page no. 383, there is a request scoped attribute currentTip.
On page 384, a getter method getCurrentTip() gets the currentTip
pageContent.getCurrentTip()
As far as the book has taught, getter methods get properties of the attribute.
currentTip can not be an attribute then.


Is pageContent attribute and currentTip its property?

It was taught that property is what is obtained from getProperty() method:-
getName() is a method, then name is the property.


Thank You SIR
 
J. Kevin Robbins
Bartender
Posts: 1759
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the book errata:

I think the line ${pageContent.currentTip} should be ${pageContext.currentTip}. Also 3 occurences on page 384

Note from the Author or Editor:
The 'pageContent' was meant to be a wrapper object, but the text never made that clear. Rewrite the third line of code as: ${currentTip}

So pageContent is an object (such as a bean) and currentTip is a property.

You can find the errata here:

http://oreilly.com/catalog/errata.csp?isbn=9780596516680

You'll need it. There are lots of errors including some invalid test answers.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic