PRJ321 Exam Questions AND Correct Answers
a - ✔✔A session is begun when servlet code invokes
__________
Choose one answer.
a. HttpServletRequest.getSession()
b. HttpServletResponse.getSession()
c. HttpSession.getSession() method
d. All of the others.
a - ✔✔In request dispatcher, both ______ and _______
methods are used for servlet communication
Choose one answer.
a. include/ forward
b. forward/ sendRedirect
c. forward/ response
d. include/ sendRedirect
a - ✔✔In the web deployment descriptor, the url-pattern tag
of servlet-mapping tag is used for _________
Choose one answer.
,a. accessing or calling the servlet instance
b. informing server about the location of servlet in web
application directory
c. applying the filter on the servlet instance
d. applying the security on the servlet instance
a - ✔✔Name of the class that includes the getSession method
that is used to get the HttpSession object.
Choose one answer.
a. HttpServletRequest
b. SessionContext
c. SessionConfig
d. HttpServletResponse
a - ✔✔The _____ directory contains the archive files requires
for Web Application such as database drivers
Choose one answer.
a. lib
b. tlds
c. classes
,d. tags
a - ✔✔The ________ method called by the servlet container to
allow the servlet to response to a request
Choose one answer.
a. service()
b. getServletContext()
c. init()
d. getInitParameter()
a - ✔✔The ________ method returns a reference to the
ServletContext Object
Choose one answer.
a. getServletContext()
b. getInitParameter()
c. init()
d. service()
a - ✔✔The ________ method returns a string containing the
value of the named initialisation parameter
, Choose one answer.
a. getInitParameter()
b. getServletConfig()
c. init()
d. jspInit
a - ✔✔The ________ method returns the actual length of the
request sent by the client
Choose one answer.
a. getContentLength()
b. getServerName()
c. getParameter()
d. getAttribute()
a - ✔✔When a specific request is processed, some servlets
must be called and they need to access some common data.
These common data should be put to dynamic variables in the
..... scope( select the most correct option).
Choose one answer.
a - ✔✔A session is begun when servlet code invokes
__________
Choose one answer.
a. HttpServletRequest.getSession()
b. HttpServletResponse.getSession()
c. HttpSession.getSession() method
d. All of the others.
a - ✔✔In request dispatcher, both ______ and _______
methods are used for servlet communication
Choose one answer.
a. include/ forward
b. forward/ sendRedirect
c. forward/ response
d. include/ sendRedirect
a - ✔✔In the web deployment descriptor, the url-pattern tag
of servlet-mapping tag is used for _________
Choose one answer.
,a. accessing or calling the servlet instance
b. informing server about the location of servlet in web
application directory
c. applying the filter on the servlet instance
d. applying the security on the servlet instance
a - ✔✔Name of the class that includes the getSession method
that is used to get the HttpSession object.
Choose one answer.
a. HttpServletRequest
b. SessionContext
c. SessionConfig
d. HttpServletResponse
a - ✔✔The _____ directory contains the archive files requires
for Web Application such as database drivers
Choose one answer.
a. lib
b. tlds
c. classes
,d. tags
a - ✔✔The ________ method called by the servlet container to
allow the servlet to response to a request
Choose one answer.
a. service()
b. getServletContext()
c. init()
d. getInitParameter()
a - ✔✔The ________ method returns a reference to the
ServletContext Object
Choose one answer.
a. getServletContext()
b. getInitParameter()
c. init()
d. service()
a - ✔✔The ________ method returns a string containing the
value of the named initialisation parameter
, Choose one answer.
a. getInitParameter()
b. getServletConfig()
c. init()
d. jspInit
a - ✔✔The ________ method returns the actual length of the
request sent by the client
Choose one answer.
a. getContentLength()
b. getServerName()
c. getParameter()
d. getAttribute()
a - ✔✔When a specific request is processed, some servlets
must be called and they need to access some common data.
These common data should be put to dynamic variables in the
..... scope( select the most correct option).
Choose one answer.