0% found this document useful (0 votes)
82 views

Answers Are in The End of File: Enterprise Java Questions and Answers Set 3

The document discusses questions and answers related to enterprise Java concepts. It includes 30 questions related to servlets, EJBs, JSPs, and JavaBeans. The answers provided explain that the doPost() method of a servlet can be called multiple times, CMP entity beans use EJB-QL for queries, and RequestDispatcher is used to forward requests between servlets. It also clarifies valid scopes for JavaBeans in JSPs and behaviors of tags like <jsp:useBean>.

Uploaded by

abc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Answers Are in The End of File: Enterprise Java Questions and Answers Set 3

The document discusses questions and answers related to enterprise Java concepts. It includes 30 questions related to servlets, EJBs, JSPs, and JavaBeans. The answers provided explain that the doPost() method of a servlet can be called multiple times, CMP entity beans use EJB-QL for queries, and RequestDispatcher is used to forward requests between servlets. It also clarifies valid scopes for JavaBeans in JSPs and behaviors of tags like <jsp:useBean>.

Uploaded by

abc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Enterprise Java Questions and Answers Set 3

Answers are in the end of file


Questions 21 To 30

21. Which method of the servlet is/are called several times in its life?  

(a) init()
(b) doPost() 
(c) destroy()
(d) Both (a) and (b) above
(e) Both (a) and (c) above.

22. Which EJB uses EJB-QL for query operations?            

(a) BMP Entity Bean 


(b) CMP Entity Bean
(c) Session Bean
(d) Message-Driven Bean
(e) MCP Entity Bean.

23. Which object is used to forward the request processing from one servlet to another?  

(a) ServeltContext
(b) ServletConfig
(c) RequestDispatcher
(d) ResponseDispatcher
(e) ResponseRedirect.

24. Which is not a valid scope for Java bean in JSP?       

(a) Page
(b) Session
(c) Request
(d) Application
(e) Global.

25. Which of the following allows substitution of code to occur at the translation time in
a JSP page?                                 

(a) <jsp:include> Tag


(b) <@ include> directive
(c) <@ page > directive
(d) Declaration block
(e) None of the above.

26. Which of the following property of Java Bean represents a single value?     

(a) Simple property 


(b) Boolean property 
(c) Indexed property
(d) Both (a) and (b) above
(e) Both (b) and (c) above.

27. Which of the following is used to redirect the response from a servlet to a JSP page? 

(a) response.sendRedirect() 
(b) request.sendRedirect() 
(c) request.forward()
(d) response.forward() 
(e) request.dispatch().

28. Which of the following is true for Java Bean?    

(a) It can not be a GUI component


(b) It never implements serializable interface
(c) It has zero-argument constructor
(d) It is a distributed component
(e) It has a non zero argument constructor.

29. Which of the following is not true for <jsp:useBean> tag in JSP page?    

(a) Locates a bean instance


(b) Stores object reference of the bean in a variable
(c) Creates an instance if fails to locate the bean instance
(d) Does not execute the body tag if any
(e) All the above.

30. Which of the following are not an implicit object in JSP?      

I. Request. 
II. Session. 
III. Vector. 
IV. In.

(a) Both (I) and (II) above


(b) Both (II) and (III) above 
(c) Both (I) and (III) above 
(d) Both (II) and (IV) above 
(e) Both (III) and (IV) above.
Answers And Explanation 

           Ans                               Explanation

21.         B       dopost() method of the servlet is called several times in its life.

22.         B       cmp entity bean uses ejb-ql for query operations.

23.         C       Request Dispatcher is used to forward the request processing from


one servlet 
                        to another.

24.         E       Global is not a valid scope for java bean in Jsp.

25.         B       <@ include> directive allows substitution of code to occur at the


translation 
                        time in a JSP page

26.         D       simple property and bolean property represents a single value.

27.         A       response.sendRedirect() is used to redirect the response from a


servlet to a 
                        JSP page.

28.         C       java bean has a zero-argument constructor

29.         D       jsp:use bean tag is not used to execute the body of tag if any.

30.         E       vector and in are not implicit objects.

You might also like