单项选择题A JSP page needs to perform some operations before servicing the first request. Where can this be done?()

A. within a method called jspInit
B. within the page directive of the JSP page
C. within a scriptlet at the top of the JSP page
D. within the  XML element


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题


Which two successfully translate and result in a value of true?()

A. ${true or false}
B. ${requestScope[foo][0] > 500}
C. ${requestScope[“foo”][1] = 420}
D. ${(requestScope[“foo”][0] lt 50) && (3 gt 2)

2.单项选择题


Which EL expression, inserted at line 3 is valid and evaluated to “beanValue”?()

A. ${bean}
B. ${value}
C. ${beanValue}
D. ${com.example.bean}
E. ${requestScope[“com.example.bean”]}
F. ${request.get(“com.example.bean”).toString()}

3.单项选择题Which method must be used to encode a URL passed as an argument to  HttpServletResponse.sendRedirect when using URL rewriting for session tracking?()

A. ServletResponse.encodeURL
B. HttpServletResponse.encodeURL
C. ServletResponse.encodeRedirectURL
D. HttpServletResponse.encodeRedirectURL

4.单项选择题


What is the result when a request is sent to MyServlet?()

A. An IllegalStateException is thrown at runtime.
B. An InvalidSessionException is thrown at runtime.
C. The string “value=null” appears in the response stream.
D. The string “value=myAttributeValue” appears in the response stream.

5.单项选择题


Which statement, inserted at line 16, unbinds an attribute from a session?()

A. session.unbind(“key”);
B. session.remove(“key”);
C. session.removeAttribute(“key”);
D. session.unbindAttribute(“key”);
E. session.deleteAttribute(“key”);

6.单项选择题Which the statement is true about web container session management()?

A. Access to session-scoped attributes is guaranteed to be thread-safe by the web container.
B. To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.
C. If the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.
D. The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.

7.多项选择题

Which two are true? ()

A. Tag files can only be accessed using a tagdir attribute.
B. The sort.jsp page translates successfully and invokes the tag defined by beta.tag.
C. The sort.jsp page produces a translation error because a taglib directive must always have a uri attribute.
D. Tag files can only be placed in /WEB-INF/tags, and NOT in any subdirectories of /WEB-INF/tags.
E. The tagdir attribute in line 2 can be replaced by a uri attribute if a TLD referring to beta.tag is created and added to the web application.

8.多项选择题Which the two are true about the JSTL core iteration custom tags?()

A. It may iterate over arrays, collections, maps and strings.
B. The body of the tag may contain EL code, but not scripting code.
C. When looping over collections, a loop status object may be used in the tag body.
D. It may iterate over a map, but only the key of the mapping may be used in the tag body.
E. When looping over integers (for example begin1=’1’ end=’10’), a loop status object may not be used in the tag body.

9.多项选择题


Which two are true?()

A. The prefix ‘java’ is reserved.
B. The URI ‘myTags’ must be properly mapped to a TLD file by the web container.
C. A translation error occurs because the prefix is considered identical by the web container.
D. For the tag usage , the tag1 must be unique in the union of tag names in ‘myTags’  and ‘moreTags

10.单项选择题


To implement the design intent, which statement must be inserted at line 42?()

 

A. session = response.getSession();
B. session = request.getSession();
C. session = request.getSession(true);
D. session = request.getSession(false);
E. session = request.getSession(“jsessionid”);

最新试题

A web application uses the HttpSession mechanism to determine if a user is “logged in”. When a user supplies a valid user name and password, an HttpSession is created for that user. The user has access to the application for only 15 minutes after logging in. The code must determine how long the user has been logged in, and if this time is greater than 15 minutes, must destroy the HttpSession. Which method in HttpSession is used to accomplish this?()

题型:单项选择题

Which is the true choice about the web container request processing model()?

题型:单项选择题

Which the two are characteristics of the Service Locator pattern?()

题型:多项选择题

Which the three EL expressions, inserted at line 15, are valid and evaluate to "3"? ()

题型:多项选择题

A developer is designing a web application which extensively uses EJBs and JMS. The developer finds that there is a lot of duplicated code to build the JNDI contexts to access the beans and queues. Further, because of the complexity, there are numerous errors in the code. Which J2EE design pattern provides a solution for this problem?()

题型:单项选择题

Which path, relative to a web application’s root, identifies the web application’s deployment descriptor?()

题型:单项选择题

A JSP page, current.jsp, is created to display the current weather report. The weather report is contained in a weather.html page that is rewritten every five minutes. Which line, appearing in current.jsp, ensures that the most recent version of weather.html is included whenever current.jsp is referenced?()

题型:单项选择题

What else must the developer do to ensure that the intended security goal is achieved()?  

题型:单项选择题

Which two classes or interfaces provide a getSession method?()

题型:多项选择题

Which three are guaranteed to be valid for the  element of a web application deployment descriptor?()

题型:多项选择题