Given an HttpServletRequest request: 22.String id = request.

题目
多选题
Given an HttpServletRequest request: 22.String id = request.getParameter("jsessionid"); 23.// insert code here 24.String name = (String) session.getAttribute("name"); Which three can be placed at line 23 to retrieve anexisting HttpSession object?()
A

HttpSession session = request.getSession();

B

HttpSession session = request.getSession(id);

C

HttpSession session = request.getSession(true);

D

HttpSession session = request.getSession(false);

E

HttpSession session = request.getSession(jsessionid);

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

We regret to ()that it may not be possible to deal with every request.

A、put off

B、pass on

C、help along

D、point out


参考答案:D

第2题:

Which is a benefit of precompiling a JSP page?()

  • A、It avoids initialization on the first request.
  • B、It provides the ability to debug runtime errors in the application.
  • C、It provides better performance on the first request for the JSP page.
  • D、It avoids execution of the _jspService method on the first request.

正确答案:C

第3题:

She said nothing ( ) your request.

A、regarding

B、regards

C、regarded


参考答案:A

第4题:

JSP从HTML表单中获得用户输入的正确语句为()。

  • A、Request.getParameter(“ID”)
  • B、Reponse.getParameter(“ID”)
  • C、Request.getAttribute(“ID”)
  • D、Reponse.getAttribute(“ID”)

正确答案:A

第5题:

Given a header in an HTTP request:X-Retries:4 Which two retrieve the value of the header from a given HttpServletRequest request?()

  • A、Request.getHeader("X-Retries")
  • B、Request.getIntHeader("X-Retries")
  • C、Request.getRequestHeader("X-Retries")
  • D、Request.getHeaders("X-Retries").get(0)
  • E、Request.getRequestHeaders("X-Retries").get(0)

正确答案:A,B

第6题:

Servlet的基本架构

public class ServletName extends HttpServlet {

public void doPost(HttpServletRequest request, HttpServletResponse response) throws

ServletException, IOException {

}

public void doGet(HttpServletRequest request, HttpServletResponse response) throws

ServletException, IOException {

}

}

1、用String的方法将数据类型转换为String。


正确答案:

 

1、String.valueOf(1.23)

第7题:

Given an HttpServletRequest request: 22.String id = request.getParameter("jsessionid"); 23.// insert code here 24.String name = (String) session.getAttribute("name"); Which three can be placed at line 23 to retrieve anexisting HttpSession object?()

  • A、HttpSession session = request.getSession();
  • B、HttpSession session = request.getSession(id);
  • C、HttpSession session = request.getSession(true);
  • D、HttpSession session = request.getSession(false);
  • E、HttpSession session = request.getSession("jsessionid");

正确答案:A,C,D

第8题:

The use of the passive voice cannot soften a request.()


正确答案:错

第9题:

下面关于HttpServletRequest接口描述错误的是()

  • A、HttpServletRequest接口中最常用的方法就是获得请求的参数
  • B、JSP中的内建对象request是一个HttpServletRequest实例
  • C、HttpServletRequest主要处理读取和写入HTTP头标
  • D、HttpServletRequest主要处理取得路径信息和标识HTTP会话,取得和设置cookies
  • E、HttpServletRequest主要处理取得输入和输出流

正确答案:E

第10题:

下列哪种方式可以在session中保存一个名为"name",值为"newer"的属性()

  • A、request.getSession().setAttribute(“name”,"newer")
  • B、request.getSession().getAttribute(“ID”,id);
  • C、request.getSession().setParameter(“ID”,id);
  • D、request.getSession().getParameter(“ID”,id)

正确答案:A

更多相关问题