This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes the importance of an argument.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "the importance of an argument...." Watch "the importance of an argument...." New topic
Author

the importance of an argument....

Bert Meijers
Greenhorn

Joined: Feb 06, 2011
Posts: 15
Hi All

Still preparing for my OCWCD, finding myself in HeadFirst SCWCD 1.4, struggling the final mock-exam.
I am trying to get a feel for the sort and way of questioning.

Page 783, question 41 B: "In all scopes attributes can be retrieved using a getAttribute() method".

According HF this answer is correct. According to my API's, all the getAttribute()-methods have
an argument (String name).

Sooo what do you think, never mind the arguments?


Greetz
Bert

Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

Howdy Bert!

Could you please quote the question? I do not posses the Head First Servlets and JSP 1st edition book, so it's hard to answer to your question.


OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
Bert Meijers
Greenhorn

Joined: Feb 06, 2011
Posts: 15
Yiehaa Pedro,

Ok, some quotations to complete the question in question....

Which about web attributes are true?
(Choose all that apply.)

A. No attributes are longer lived than session attributes.
B. In all scopes, attributes can be retrieved using a getAttribute() methode.
C. Context attributes survive a session time-out.
D. Only session and context attributes can be retrieved in an enumeration.
E. Data stored in both request and session objects is thread safe.


HF tells me that B and C are the correct answers, and I agree questionless upon C.

My remark is about the statement made at B's, because the argument to the method (String name)
is omitted. Not mentionned, zippo, gone with the wind, computer says no

And I do see what they mean to ask (that is, I hope...), but, looking forward to the exam,
I hope not be examined in a way of "we hope you've got what we really intended to ask..."

Bottom-line: how exact are questions to be interpreted on the exam.

Thanks for your response!

Bert

PS Would there be a difference between asking about a getAttribute() method and asking about the getAttribute() method?







Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

Now I understand what you're talking about :-)

Yea, I guess it's a common problem how to describe a method without specifying what parameters are you interested in.
ExamLab for OCPJP used the "-" character to denote this, like this: getAttribute(-).

It means that whatever arguments the method takes, they're not important - only the name and overall purpose is important for the question.

Frankly, when reading your question, I would undoubtedly say B is correct, as I would treat getAttribute() as it would be written with the (-) thing I talked about above. But the fact remains - I think they should explicitly said what they had on their minds...

By the way: the same problem is with denoting the class which the method comes from. Some books might use the ServletRequest.getAttribute(String) construct, which can be misleading and understood by some users as it's a static method from the ServletRequest class, where the real purpose was to show that the getAttribute(String) method comes from the ServletRequest class.

Once again - you can use more adequate form taken i.e. from the JavaDoc - ServletRequest#getAttribute(String) which shouldn't be problematic from now on.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: the importance of an argument....
 
Similar Threads
Sending argument from one servlet to another servlet
jdbc transaction mangement and behaviour
Session variables are not getting storred
cannot resolve Symbol
overloading constructor