Scripts- Server Side-JSP [Computer Associates Placement]: Sample Questions 15 - 16 of 18

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 15

Appeared in Year: 2004

Question

MCQ▾

EJB class should implement

Choices

Choice (4)

a.

javax. Ejb. Rmi

b.

javax. Ejb. EJBHome

c.

javax. Ejb. EntityBean

d.

javax. Ejb. EJBObject

Answer

c.

Explanation

EJB Implementation:

The EJB Implementation
  • An entity bean is a remote object that manages its data persistently through callback methods, which are defined in the javax. ejb. EntityBean interface.
  • When you implement the EntityBean interface in your bean class, you develop each of the callback functions as designated by the type of persistence that you choose: bean-managed persistence or container-managed persistence.
  • The container invokes the callback functions at designated times, to manage the bean and its persistent data.

Question 16

Appeared in Year: 2004

Question

MCQ▾

What is legal about JSP scriplets

Choices

Choice (4)

a.

Semicolon is needed at the end of each statement in a Scriptlet

b.

A loop can begin in 1 Scriptlet and end in another

c.

Statements in Scriptlets should follow Java Syntax

d.

All a., b. and c. are correct

Answer

d.

Explanation

  • A JSP scriptlet is used to contain any code fragment that is valid for the scripting language used in a page.
  • The syntax for a scriptlet is as follows:

    <%

    Scripting-language-statements

    %>

  • When the scripting language is set to java, a scriptlet is transformed into a Java programming language statement fragment and is inserted into the service method of the JSP page՚s servlet.
  • A programming language variable created within a scriptlet is accessible from anywhere within the JSP page.

Developed by: