• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCWCD Questions

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPliotTest


During initialization the servlet instance can throw which exception.

Select 1 correct Choice.


A. ServletNotAvailableException

B. ServletException

C. UnavailableException

D. UnableToInitializeException

Correct answer is C

But according to
SRV.2.3.2.1 Error Conditions on Initialization
During initialization, the servlet instance can throw an UnavailableException or a ServletException.

Is the option C correct ?

-------------------------------------------------------------------
Which of the following are valid uses of the <jsp:useBean> action?

Select all 2 correct Choices.


A. <jsp:useBean id="myBean" class="MyBean" scope="session">

B. <jsp:useBean id="myBean" class="MyBean"/>

C. <jsp:useBean id="myBean" class="MyBean" beanName="SomeOtherBean"/>

D. <jsp:useBean id="myBean" type="MyBean">

Correct answer:B,D

Though 2 options have to be selected,

why can't option A not be included in the correct answer ?
we can specify scope with useBean action

--------------------------------------------------------------------------------------
Which of the following is a valid taglib directive?

Select 1 correct Choice.


A. <@ taglib tagPrefix="myTag" tagURI="taglibURI"%>

B. <@ taglib name="myTag" locationURI="taglibURI"%>

C. <@ taglib prefix="myTag" uri="taglibURI">

D. <@ taglib prefix="myTag" uri="taglibURI"/>

Correct answer is D

Why isn't C correct ?
C seems to be valid syntax

----------------------------------------------------------------------------
 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohitkumar gupta wrote:
Which of the following are valid uses of the <jsp:useBean> action?

Select all 2 correct Choices.


A. <jsp:useBean id="myBean" class="MyBean" scope="session">

B. <jsp:useBean id="myBean" class="MyBean"/>

C. <jsp:useBean id="myBean" class="MyBean" beanName="SomeOtherBean"/>

D. <jsp:useBean id="myBean" type="MyBean">

Correct answer:B,D

Though 2 options have to be selected,

why can't option A not be included in the correct answer ?
we can specify scope with useBean action

--------------------------------------------------------------------------------------
Which of the following is a valid taglib directive?

Select 1 correct Choice.


A. <@ taglib tagPrefix="myTag" tagURI="taglibURI"%>

B. <@ taglib name="myTag" locationURI="taglibURI"%>

C. <@ taglib prefix="myTag" uri="taglibURI">

D. <@ taglib prefix="myTag" uri="taglibURI"/>

Correct answer is D

Why isn't C correct ?
C seems to be valid syntax

----------------------------------------------------------------------------


The tag must end with />, not only ">".
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Haina,
If that is the case(The tag must end with />, not only ">".) then why is
D.
correct answer ?
 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohitkumar gupta wrote:Thanks Haina,
If that is the case(The tag must end with />, not only ">".) then why is
D.
correct answer ?


Definitely it is wrong if the tag does not end with "/>"
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Haina
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic