试题详情
单项选择题 Given the definition of MyServlet: 11.public class MyServlet extends HttpServlet { 12.public void service(HttpServletRequest request, 13.HttpServletResponse response) 14.throws ServletException, IOException { 15.HttpSession session = request.getSession(); 16.session.setAttribute("myAttribute","myAttributeValue"); 17.session.invalidate(); 18.response.getWriter().println("value=" + 19.session.getAttribute("myAttribute")); 20.} 21.} 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
  • 关注下方微信公众号,在线模考后查看

热门试题