Advanced Java Programming (3160707) MCQs

MCQs of Java Server Pages

Showing 1 to 10 out of 30 Questions
1.
A JSP technically gets converted to a _____ during translation time.
(a) web page
(b) servlet
(c) servlet config
(d) JSP config
Answer:

Option (b)

2.
Except ______ phase, a JSP page is handled exactly like a Servlet
(a) Translation
(b) Request
(c) Response
(d) Initialization
Answer:

Option (a)

3.
______page directive should be used in JSP to generate a PDF.
(a) contentType
(b) contentPDF
(c) TypePDF
(d) MIMEpdf
Answer:

Option (a)

4.
request is the instance of ______ class.
(a) ServletRequest
(b) Request
(c) GenericRequest
(d) HttpRequest
Answer:

Option (d)

5.
_____ object can be used to access other implicit objects in JSP.
(a) page
(b) pageContext
(c) context
(d) request
Answer:

Option (b)

6.
______ method can be used to read a multiple values with same name, for example check box selections?
(a) response.getParameterValues()
(b) request.getParameter()
(c) response.getParameter()
(d) request.getParameterValues()
Answer:

Option (d)

7.
What is default value of autoFlush Attribute?
(a) True
(b) False
Answer:

Option (a)

8.
A scriptlet can contain which of the following:
i. JAVA language statements
ii. Variable
iii. EL scripting
iv. Method declarations
v. Expressions
vi. directives
(a) i,ii,iv,v
(b) i,ii,iii,iv
(c) iii,iv,v,vi
(d) ii,iv,v,i
Answer:

Option (a)

9.
Select the correct format of JSP comment.
(a) <%-- comment --%>
(b) /* comment */
(c) // comment
(d) <!-- html -->
Answer:

Option (a)

10.
By convention, page directives are coded at ______ of the JSP page.
(a) top
(b) bottom
(c) scriplet
(d) declaration
Answer:

Option (a)

Showing 1 to 10 out of 30 Questions