wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz 9 - JSP_TalentNext

Total questions: 8

Worksheet time: 4mins

Name
Class
Date
1.
Which of the following is used to declare instance variable through JSP Page?
a)
<% int iVar=0; %>
b)
<%! int iVar=0; %>
c)
<%! int iVar=0 %>
d)
<%= int iVar=0; %>
2.
Which is of the following are valid expression tag for the given variables a and b?
a)
<%=a+b %>
b)
<%=a+b; %>
c)
<%!a+b %>
d)
<%!a+b; %>
3.
<%@ inlcude > directive uses which attribute to include Page2.jsp?
a)
page="Page.jsp"
b)
file="Page.jsp"
c)
forward="Page.jsp"
d)
all of the above
4.

Predict the output: Provided uname text field with the value "Harry"


<html>

<body>

<%= "Welcome "+request.getParameter("uname") %>

</body>

</html>

a)

Welcome Harry

b)

Harry

c)

500 Internal Server Error : Null Pointer Exception

d)

JSP Translation Error: request not declared

5.

Which of the following are Page directive attributes?

a)

import

b)

extends

c)

pageEncoding

d)

prefix

6.

Exception implicit object is recognized by setting which of the following attribute?

a)

errorPage=true

b)

errorPage=false

c)

isErrorPage=true

d)

isErrorPage=false

7.

Which jsp code is equivalent to the below given code:


public String getServletInfo() {

return "Happy Learning JSPs";

}

a)

<%@ page info="Happy Learning JSPs" %>

b)

<%@ page servlet-info="Happy Learning JSPs" %>

c)

<%@ page information="Happy Learning JSPs" %>

d)

<%@ page servlet-information="Happy Learning JSPs" %>

8.

Which of the following tags are used for forwarding the request and response to another resource?

a)

<jsp:include>

b)

<jsp:forward>

c)

<% @ include%>

d)

<% @ forward%>