题目内容
(请给出正确答案)
[单选题]
在JavaWeb应用程序中,给定servletA的代码片段如下所示:PublicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{Stringid=”kingdom”;_________________}ServletB与servletA同在一个有效的会话范围内,当把请求转发给servletB后,要使B能够获得”kingdom”值,下划线处应填入()
A.request.getSession().getParameter(“ID”,id)
B.request.getSession().getAttribute(“ID”,id)
C.request.getSession().setAttribute(“ID”,id)
D.request.getSession().setParameter(“ID”,id)
答案
查看答案