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
答案解析:有

微信扫一扫手机做题