Deck 3: Servlets and JSPS
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 3: Servlets and JSPS
1
Which of the following is true about servlets?
A)Servlets execute within the address space of web server
B)Servlets are platform-independent because they are written in java
C)Servlets can use the full functionality of the Java class libraries
D)Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
A)Servlets execute within the address space of web server
B)Servlets are platform-independent because they are written in java
C)Servlets can use the full functionality of the Java class libraries
D)Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
Servlets execute within the address space of web server, platform independent and uses the functionality of java class libraries
2
Which method is used to specify before any lines that uses the PrintWriter?
A)setPageType()
B)setContextType()
C)setContentType()
D)setResponseType()
A)setPageType()
B)setContextType()
C)setContentType()
D)setResponseType()
setContentType()
3
Which of the following are the session tracking techniques?
A)URL rewriting, using session object, using response object, using hidden fields
B)URL rewriting, using session object, using cookies, using hidden fields
C)URL rewriting, using servlet object, using response object, using cookies
D)URL rewriting, using request object, using response object, using session object
A)URL rewriting, using session object, using response object, using hidden fields
B)URL rewriting, using session object, using cookies, using hidden fields
C)URL rewriting, using servlet object, using response object, using cookies
D)URL rewriting, using request object, using response object, using session object
URL rewriting, using session object, using cookies, using hidden fields
4
The getSession() method with „true? as its parameter [ getSession(true) ] it will return the appropriate session object when
A)the session is completed
B)the session object is passed to another method
C)the session does not exists
D)the session is existing
A)the session is completed
B)the session object is passed to another method
C)the session does not exists
D)the session is existing
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
A servlet maintain session in
A)Servlet container
B)Servlet context
C)Servlet request heap
D)Servlet response heap
A)Servlet container
B)Servlet context
C)Servlet request heap
D)Servlet response heap
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
Servlet mapping defines
A)an association between a URL pattern and a servlet
B)an association between a URL pattern and a request page
C)an association between a URL pattern and a response page
D)All of the above
A)an association between a URL pattern and a servlet
B)an association between a URL pattern and a request page
C)an association between a URL pattern and a response page
D)All of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
The life cycle of a servlet is managed by
A)servlet context
B)servlet container
C)the supporting protocol (such as http or https)
D)all of the above
A)servlet context
B)servlet container
C)the supporting protocol (such as http or https)
D)all of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
The init parameter name and value pairs that are defined in web.xml file are handled by
A)ServletConfig object
B)ServletContext object
C)ServletRequest object
D)ServletResponse object
A)ServletConfig object
B)ServletContext object
C)ServletRequest object
D)ServletResponse object
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
How many ServletContext objects are available for an entire web application?
A)One each per servlet
B)One each per request
C)One each per response
D)Only one
A)One each per servlet
B)One each per request
C)One each per response
D)Only one
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
Which of the following package contains servlet classes?
A)javax.servlet
B)javax.servlet.http
C)Both of the above
D)None of the above
A)javax.servlet
B)javax.servlet.http
C)Both of the above
D)None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
Which page directive should be used in JSP to generate a PDF page?
A)contentType
B)generatePdf
C)typePDF
D)contentPDF
A)contentType
B)generatePdf
C)typePDF
D)contentPDF
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
Which tag should be used to pass information from JSP to included JSP?
A)Using <%jsp:page> tag
B)Using <%jsp:param> tag
C)Using <%jsp:import> tag
D)Using <%jsp:useBean> tag
A)Using <%jsp:page> tag
B)Using <%jsp:param> tag
C)Using <%jsp:import> tag
D)Using <%jsp:useBean> tag
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
Application is instance of which class?
A)javax.servlet.Application
B)javax.servlet.HttpContext
C)javax.servlet.Context
D)javax.servlet.ServletContext
A)javax.servlet.Application
B)javax.servlet.HttpContext
C)javax.servlet.Context
D)javax.servlet.ServletContext
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
_jspService() method of HttpJspPage class should not be overridden.
A)True
B)False
C)none
D)all
A)True
B)False
C)none
D)all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
Which option is true about session scope?
A)Objects are accessible only from the page in which they are created
B)Objects are accessible only from the pages which are in same session
C)Objects are accessible only from the pages which are processing the same request
D)Objects are accessible only from the pages which reside in same application
A)Objects are accessible only from the page in which they are created
B)Objects are accessible only from the pages which are in same session
C)Objects are accessible only from the pages which are processing the same request
D)Objects are accessible only from the pages which reside in same application
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
Default value of autoFlush attribute is?
A)true
B)false
C)none
D)all
A)true
B)false
C)none
D)all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
Which one is the correct order of phases in JSP life cycle?
A)Initialization, Cleanup, Compilation, Execution
B)Initialization, Compilation, Cleanup, Execution
C)Compilation, Initialization, Execution, Cleanup
D)Cleanup, Compilation, Initialization, Execution
A)Initialization, Cleanup, Compilation, Execution
B)Initialization, Compilation, Cleanup, Execution
C)Compilation, Initialization, Execution, Cleanup
D)Cleanup, Compilation, Initialization, Execution
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
"request" is instance of which one of the following classes?
A)Request
B)HttpRequest
C)HttpServletRequest
D)ServletRequest
A)Request
B)HttpRequest
C)HttpServletRequest
D)ServletRequest
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
Which is not a directive?
A)include
B)page
C)export
D)useBean
A)include
B)page
C)export
D)useBean
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
Which is mandatory in tag?
A)id, class
B)id, type
C)type, property
D)type,id
A)id, class
B)id, type
C)type, property
D)type,id
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
Which one of the following is correct for directive in JSP?
A)<%@directive%>
B)<%!directive%>
C)<%directive%>
D)<%=directive%>
A)<%@directive%>
B)<%!directive%>
C)<%directive%>
D)<%=directive%>
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
Which of the following action variable is used to include a file in JSP?
A)jsp:setProperty
B)jsp:getProperty
C)jsp:include
D)jsp:plugin
A)jsp:setProperty
B)jsp:getProperty
C)jsp:include
D)jsp:plugin
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
Which attribute uniquely identification element?
A)ID
B)Class
C)Name
D)Scope
A)ID
B)Class
C)Name
D)Scope
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
"out" is implicit object of which class?
A)javax.servlet.jsp.PrintWriter
B)javax.servlet.jsp.SessionWriter
C)javax.servlet.jsp.SessionPrinter
D)javax.servlet.jsp.JspWriter
A)javax.servlet.jsp.PrintWriter
B)javax.servlet.jsp.SessionWriter
C)javax.servlet.jsp.SessionPrinter
D)javax.servlet.jsp.JspWriter
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
Which object stores references to the request and response objects?
A)sessionContext
B)pageContext
C)HttpSession
D)sessionAttribute
A)sessionContext
B)pageContext
C)HttpSession
D)sessionAttribute
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck