Practice objective questions
for quick revision and examination
preparation. Try answering each question
before revealing the answer.
📚 Web Technologies
📖 Unit 4
🎯 MCQs
Web Technologies MCQs - Unit 4
Web Technologies MCQs - Unit 4
1
Which page directive should be used in JSP to generate a PDF page?
AcontentType
BgeneratePdf
CtypePDF
DcontentPDF
Correct AnswerA
2
Which tag should be used to pass information from JSP to included JSP?
AUsing <%jsp:page> tag
BUsing <%jsp:param> tag
CUsing <%jsp:import> tag
DUsing <%jsp:useBean> tag
Correct AnswerA
3
Application is instance of which class?
Ajavax.servlet.Application
Bjavax.servlet.HttpContext
Cjavax.servlet.Context
Djavax.servlet.ServletContext
Correct AnswerD
4
Which option is true about session scope?
AObjects are accessible only from the page in which they are created
BObjects are accessible only from the pages which are in same session
CObjects are accessible only from the pages which are processing the same request
DObjects are accessible only from the pages which reside in same application
Correct AnswerB
5
Which one is correct order of phases in JSP life cycle?
AInitialization, Cleanup, Compilation, Execution
BInitialization, Compilation, Cleanup, Execution
CCompilation, Initialization, Execution, Cleanup
DCleanup, Compilation, Initialization, Execution
Correct AnswerC
6
"request" is instance of which one of the foloowing classes?
ARequest
BHttpRequest
CHttpServletRequest
DServletRequest
Correct AnswerC
7
Which is not a directive?
Ainclude
Bpage
Cexport
DuseBean
Correct AnswerC
8
Which is mandatory in tag?
Aid, class
Bid, type
Ctype, property
Dtype,id
Correct AnswerA
9
Which of the following attributes are mandatory in <jsp:getProperty /> tag?
Aname, property
Btype, id
Cname, type
Did, property
Correct AnswerA
10
Which of the following is true about language attribute?
AThe language attribute indicates the programming language used in scripting the servlet.
BThe language attribute indicates the programming language used in scripting the html page.
CThe language attribute indicates the programming language used in scripting the JSP page.
DNone of the above.
Correct AnswerC
11
Which of the following method can be used to read binary data stream coming from the client?
Arequest.getInputStream()
Bresponse.getInputStream()
Crequest.getInputStreamData()
Dresponse.getInputStreamData()
Correct AnswerA
12
Which of the following is true about extends Attribute?
AThe extends attribute can be used to define a subclass of generated servlet.
BThe extends attribute is used to specify a superclass that the generated servlet must extend.
CBoth of the above.
DNone of the above.
Correct AnswerB
13
Which of the following is true about isScriptingEnabled Attribute?
AThe isScriptingEnabled attribute determines if scripting elements are allowed for use.
BThe default value (true) enables scriptlets, expressions, and declarations.
CBoth of the above.
DNone of the above.
Correct AnswerC
14
Which of the following is true about <jsp:useBean> action?
AuseBean action first searches for an existing object utilizing the id and scope variables. If an object is not found, it then tries to create the specified object.
BuseBean is used to load java beans in jsp page.
CBoth of the above.
DNone of the above.
Correct AnswerC
15
Which of the following is true about response.sendRedirect(url)?
AThe sendRedirect sends HTTP temporary redirect response to the browser.
BRequest data gets lost in case of sendRedirect.
CBoth of the above.
DNone of the above.
Correct AnswerC
16
Which of the following is true about <c:redirect> tag?
AThe <c:redirect > tag redirects the browser to an alternate URL by providing automatically URL rewriting.
BThe <c:redirect > tag supports context-relative URLs.