1
Which one of the following methods of ServletConfig interface retrieves the value of the initialization parameter?
getServletName()
getInitParameter()
getServerInfo()
getServletContext()
2
Which one of the following methods of HttpServletRequest interface indicates whether the authenticated user is included in the logical "role"?
getSession()
isUserInRole()
getUserPrincipal()
isRequestedSessionIdValid()
3
The implicit object ?out? is equivalent to an instance of ________ class.
OutputStream
PrintStream
PrintWriter
JspWriter
4
Which of the following implicit object is not available to use in EL expressions?
param
cookie
header
pageContext
contextScope
5
What will be the output of following expression if used in a JSP page?
${7 % 2}
1
72
7 % 2
{7 % 2}
3
6
Which one of the following JSTL tags is used to iterate through a collection of objects?
A.
B.
C.
D.
E.
F.
A
B
C
D
E
F
7
Which method starts the process of the evaluation of the body inside the tag for the first time?
public void doTag()
public void doInitBody()
public void doStartTag()
public void init()
8
Which one of the following values does the SimpleTag's doTag() method return?
EVAL_BODY_INCLUDE
SKIP_BODY
void
EVAL_PAGE
SKIP_PAGE
9
Which one of the following statements includes a file named 'index.html' in a JSP page?
A.
B.
C.
D.
E.
A
B
C
D
E
10
Which one of the following statements declares the current JSP page to be an error page ?
A.
B.
C.
D.
A
B
C
D
11
Which one of the following interfaces notifies an object when it is being bound to or unbound from a session?
HttpSessionListener
HttpSessionValueListener
HttpSessionBindingListener
HttpSessionAttributeListener
12
Which one of the following attributes of a page directive specifies an HTTP response of the type "image/svg"?
type
mimeType
language
contentType
pageEncoding
13
Which one of the following authentication techniques requires a browser to use a default TCP port and an extra authentication layer in between HTTP and TCP?
HTTP Basic Authentication
Form Based Authentication
HTTP Digest Authentication
HTTPS Client Authentication
14
Which tag library contains the tags for looping, expression evaluation and basic input and output?
SQL Tag Library
Core Tag Library
XML Tag Library
Formatting/Internationalization (I18N) Tag Library
15
The _________ method is used to invoke the next filter in the filter chain.
doFilter(ServletRequest, ServletResponse)
do(HttpServletRequest, HttpServletResponse)
doFilter()
doFilter(FilterChain)
16
The ________ element, a mandatory element in a filter definition, defines the class name of the filter.
A.
B.
C.
D.
A
B
C
D
17
Read the following and state the correct answer.
The element is converted to _____________ or __________ tag after a JSP page is translated and compiled
A. ,
B. ,
C. ,
D. ,
A
B
C
D
18
Which one of the following methods returns an array of String objects containing all of the parameter values or null if parameters do not exist?
getParameterValues()
getParameterNames()
getParameter()
19
Which of the following HTTP methods can be used to send large amount of binary data from the browser to a servlet?
doGet()
doPost()
doHead()
doPut()
20
In a Web application, the Tag Library Descriptors ( TLDs) are stored _________.
only in /WEB-INF/lib directory.
only in /WEB-INF/classes directory.
in the META-INF directory of a JAR file inside the /WEB-INF/lib directory.
at the application's top-level directory.
in /WEB-INF directory or its sub-directory.
0 nhận xét:
Post a Comment