单项选择题Which HttpSession method stores an object in a session?()

A. put(String name. Object value)
B. set(String name. Object value)
C. setAttribute(String name. Object value)
D. putAttribute(String name. Object value)
E. addAttribute(String name. Object value)


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题Which element is the parent of the  tag in the web application deployment descriptor? ()

A. <web-app> 
B. <filters> 
C. <servlet> 
D. <filter-list> 

2.单项选择题


Which retrieves the value associated with “foo” from within an HttpServlet?()

A. String value = getServletConfig( ).getParameter(“foo”);
B. String value = getServletContext( ).getAttribute(“foo”);
C. Object value = getServletContext( ).getInitParameter(“foo”);
D. String value = getServletContext( ).getInitParameter(“foo”)

3.单项选择题


What is the result of a client request of the Source servlet with no query string?()

A. The output “filterAdded = null” is written to the response stream.
B. The output “filterAdded = addedByFilter” is written to the response stream.
C. An exception is thrown at runtime within the service method of the Source servlet.
D. An exeption is thrown at runtime within the service method of the Destination servlet.

4.多项选择题For a given Servletresponse response, which two retrieve an object for writing text data? ()

A. response.getWriter( )
B. response.getOutputStream( )
C. response.getOutputWriter( )
D. response.getWriter( ) .getOutputStream( )
E. response.getWriter(Writer.OUTPUT_TEXT( )

5.单项选择题


What is the result?()

A. <b></b> 
B. <b>50</b> 
C. <b>${5*10}</b> 
D. The JSP fails to execute

6.单项选择题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

7.多项选择题


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)

8.单项选择题


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()}

9.单项选择题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

10.单项选择题


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.

最新试题

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?()

题型:单项选择题

For a given product instance, which three jsp:setProperty attributes must be used to initialized its properties form the HTML form? ()

题型:多项选择题

Which code snippet, inserted at line 8, causes the value Company to be output?()

题型:单项选择题

Given the HttpServlet code:  getServletContext().setAttribute(“foo”, “value”);What is the result?()

题型:单项选择题

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

题型:多项选择题

Which the three interfaces need to be declared in the web application deployment descriptor? ()

题型:多项选择题

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

题型:多项选择题

The tag handler for n:recurse extends SimpleTagSupport.Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?()  

题型:单项选择题

Within the web application deployment descriptor, which defines a valid JNDI environment entry()

题型:单项选择题

Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()

题型:单项选择题