You are on page 1of 4

Ho va tn: Trn Quc Hng 1 1 Which one of the following methods of ServletConfig interface retrieves the value of the

e initialization parameter? A. getServletName() B. getInitParameter() C. getServerInfo() D. getServletContext() 2 Which one of the following methods of HttpServletRequest interface indicates whether the authenticated user is included in the logical "role"? A. getSession() B. isUserInRole() C. getUserPrincipal() D. isRequestedSessionIdValid() 3 The implicit object ?out? is equivalent to an instance of ________ class. A. OutputStream B. PrintStream C. PrintWriter D. JspWriter 4 Which one of the following JSTL tags is used to iterate through a collection of objects? A. <x:forEach> B. <c:iterate> C. <c:forEach> D. <c:forTokens> E. <logic:iterate> F. <logic:forEach> 5 Which method starts the process of the evaluation of the body inside the tag for the first time? A. public void doTag() B. public void doInitBody() C. public void doStartTag() D. public void init() 6 Which one of the following values does the SimpleTag's doTag() method return? A. EVAL_BODY_INCLUDE

B. SKIP_BODY C. VOID D. EVAL_PAGE E. SKIP_PAGE 7 Which one of the following interfaces notifies an object when it is being bound to or unbound from a session? A. HttpSessionListener B. HttpSessionValueListener C. HttpSessionBindingListener D. HttpSessionAttributeListener 8 Which one of the following attributes of a page directive specifies an HTTP response of the type "image/svg"? A. type B. mimeType C. language D. contentType E. pageEncoding 9 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? A. HTTP Basic Authentication B. Form Based Authentication C. HTTP Digest Authentication D. HTTPS Client Authentication 10 Which tag library contains the tags for looping, expression evaluation and basic input and output? A. SQL Tag Library B. Core Tag Library C. XML Tag Library D. Formatting/Internationalization (I18N) Tag Library 11 The ________ element, a mandatory element in a filter definition, defines the class name of the filter. A. <filter> B. <filter-class> C. <class> D. <filter-class-name>

12 Read the following and state the correct answer. The <jsp:plugin> element is converted to _____________ or __________ tag after a JSP page is translated and compiled A. <plugin>, <object> B. <object>, <embed> C. <plugin>, <embed> D. <applet>, <plugin> 13 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? A. getParameterValues() B. getParameterNames() C. getParameter() 14 Which of the following HTTP methods can be used to send large amount of binary data from the browser to a servlet? A. doGet() B. doPost() C. doHead() D. doPut() 15 In a Web application, the Tag Library Descriptors ( TLDs) are stored _________. A. only in /WEB-INF/lib directory. B. only in /WEB-INF/classes directory. C. in the META-INF directory of a JAR file inside the /WEB-INF/lib directory. D. at the application's top-level directory. E. in /WEB-INF directory or its sub-directory. 16 The _________ method is used to invoke the next filter in the filter chain. A. doFilter(ServletRequest, ServletResponse) B. do(HttpServletRequest, HttpServletResponse) C. doFilter() D. doFilter(FilterChain) 17 Which element in the deployment descriptor specifies the path to the tag library descriptor file? A. taglib B. taglib-location C. location

D. path 18 The _______ method is used to specify the time for which the servlet container keeps the session alive. A. getSession() B. getMaxInactiveInterval() C. getInterval() D. invalidate() 19 The _______________ method of ServletResponse interface is used to set its content type. A. setParameter() B. setHeader() C. setAttribute() D. setContentType() 20 ________ returns the body of request as binary data. A. getAttribute() B. getInputStream() C. getServerName() D. getParameter()

You might also like