Page 1 of 1

About Question enthuware.jwpv6.2.845 :

Posted: Mon Aug 13, 2012 12:57 pm
by ETS User
Hi,

I was wondering about question 39:

"Consider the following line of code appearing in a JSP page:
<jsp:setProperty name="hellobean" property="username" param="name" />
Which of the following statements regarding the above line of code is correct?
Assume that hellobean exists in the page scope and has a method: public void setName(String name)."

The first option is considered wrong:
"If the request contains a name parameter, its value will be set into the bean."....
But it is a bit ambiguous because it is not mentioned in the description that the setName(String name) is the one and only method of that bean..so this creates false impression that other suitable setters (setUserName(String name)) might exist...

Maybe in order to be more clear it would be nice to add in the last sentence something like "..exists in the page scope and has one only method: public void setName(String name)"

Thanks

Re: About Question enthuware.jwpv6.2.845 :

Posted: Mon Aug 13, 2012 8:48 pm
by admin
Sure, we will make it more clear. Thank you for your feedback!

Although as a general guideline for the exam, you should only assume what is explicitly stated in the question. Here, it mentions that the bean contains setName method and doesn't mention anything else, so you should not assume the presence of any other method.

HTH,
Paul.

Re: About Question enthuware.jwpv6.2.845 :

Posted: Tue Aug 14, 2012 9:44 am
by Guest
Thanks a lot for the great tips!