wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Server Page

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

The code inside scriplet will be placed in _____ method of jsp life cycle?

a)

jsp_init()

b)

jsp_service()

c)

httpService()

d)

_jspService()

2.

Choose an incorrect statement from the following.

a)

JSP is built on Java Technology so it is platform independent.

b)

The Web Container translate a Servlet into JSP page.

c)

JSP pages are easier to maintain than a servlet.

d)

A JSP page seperates presentation and business logic.

e)

ALL OF THE ABOVE

3.

Which one of the following is a syntax to create a simple JSP?

a)

<html> <body> <% out.print(2*5); %> </body> </html>

b)

<html> <body> <! out.print(2*5); !> </body> </html>

c)

other

d)

<html> <body> <%@ out.print(2*5); %> </body> </html>

e)

None of the above

4.

Which method is called only once in Servlet life cycle ?

a)

initialize()

b)

service()

c)

start()

d)

init()

e)

all of the above

5.

_________ is responsible for managing execution of servlet.

a)

Servlet Context

b)

JVM

c)

Web Container

d)

Server

6.

The code inside scriplet will be placed in _____ method of jsp life cycle?

a)

jsp_service()

b)

jsp_init()

c)

httpService()

d)

other

e)

_jspService()

7.

Choose the correct syntax of include directive?

a)

<% include file="file.jsp" %>

b)

<%@ include page="file.jsp" %>

c)

<%! include page="file.jsp" %>

d)

<%@ include file="file.jsp" %>

8.

Compilation process of JSP page involves:

a)

Parsing of JSP

b)

Turning JSP into servlet

c)

Compiling the servlet

d)

All of the above

9.

All servlet classes are required to be mapped and configured in web.xml.

a)

True

b)

False

10.

Which of the following is true about Initialization phase in JSP life cycle?

a)

Container invokes _jspService() method during Initialization phase.

b)

When a container loads a JSP it invokes the jspInit() method before servicing any requests.

c)

Both of the above.

d)

None of the above.