GeeCON Prague 2014*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Mock Exam doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Mock Exam doubt" Watch "HFSJ Mock Exam doubt" New topic
Author

HFSJ Mock Exam doubt

Xenon Parker
Greenhorn

Joined: Mar 06, 2008
Posts: 9
Following is the question from mock exam from HSFJ book.
Question 63 in the exam.

1. <%@ taglib uri="http://www.mycompany.com/mytags" prefix="mytags" %>
2. <mytags:foo bar="abc" />
3. <mytags:forEach><mytags: DoSomething /></mytags:forEach>
4. <jsp:setProperty name="x" property="a" value="b" />
5. <c: out value="hello">

Assuming this ia a complete JSP,which is true?
(For E and F. ignore the fact that an error in one line might keep a subsequent line from being reached)

A) Only line 2 will definately generate an error
B) Only line 3 will definately generate an error
C) Only line 4 will definately generate an error
D) Only line 5 will definately generate an error
E) Lines 4 and 5 will both definately generate errors
F) Lines 2, 3, 4 and 5 will all definately generate errors
G) The entire JSP could execute withtou generating errors

****************************************************

The answer given is D.

But, wouldnt option E be more preciese?
As on line 4 the setProperty is being used withtou a useBean tag. So the name attribute used in the setProperty tag refers to no one? Like using a variable without declaring it?
[ March 28, 2008: Message edited by: Xenon Parker ]
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
You could have used the jsp:useBean tag in an another page. So you're not sure that it will definitely generate an error


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
GeeCON Prague 2014
 
subject: HFSJ Mock Exam doubt