更多“HttpServletRequest接口的()方法用于创建会话。A、setSession()B、getContext()C、getSession()D、putSession()”相关问题
  • 第1题:

    获取session属性需要调用方法()。

    A.getAttribute()

    B.setAttribute()

    C.setSession()

    D.getSession()


    参考答案:A

  • 第2题:

    在public HttpSession getSession(boolean bool)的方法定义中,当bool为false时表明()

    • A、直接返回会话对象
    • B、当服务器已经创建了会话对象就返回该对象,否则返回null
    • C、直接返回null
    • D、当服务器已经创建了会话对象就返回该对象,否则新建一个会话对象并返回

    正确答案:B

  • 第3题:

    J2EE中,哪个类的哪个方法用于创建对话?()

    • A、HttpServletRequest、getSession
    • B、HttpServletResponse、newSession
    • C、HtttpSession、newInstance
    • D、HttpSession、getSession

    正确答案:A

  • 第4题:

    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

  • 第5题:

    J2EE中,HttpServletRequest类的()方法用返回与当前请求相关联的会话,如果没有,则返回null。

    • A、getSession(null)
    • B、getSession(true)
    • C、getSession(false)

    正确答案:C

  • 第6题:

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

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

    正确答案:E

  • 第7题:

    创建Canvas画布使用的方法是:()

    • A、getContext("3d");
    • B、document.Context("3d");
    • C、getContext("2d");
    • D、document.Context("2d");

    正确答案:C

  • 第8题:

    多选题
    在J2EE中,对于在Servlet如何获得会话,描述正确的是()。
    A

    HttpServletRequest类的getSession方法有两个:带参数的getSession方法和不带参数的getSession方法

    B

    在Servlet中,可以使用HttpSession session = new HttpSession()创建session对象

    C

    如果HttpServletRequest类的getSession方法的参数为false,表示如果没有与当前的请求相联系的会话对象时,该方法返回null

    D

    如果HttpServletRequest类的getSession方法的参数为true,表示如果没有与当前的请求相联系的会话对象时,该方法返回null


    正确答案: C,D
    解析: 暂无解析

  • 第9题:

    单选题
    在public HttpSession getSession(boolean bool)的方法定义中,当bool为false时表明()
    A

    直接返回会话对象

    B

    当服务器已经创建了会话对象就返回该对象,否则返回null

    C

    直接返回null

    D

    当服务器已经创建了会话对象就返回该对象,否则新建一个会话对象并返回


    正确答案: B
    解析: 暂无解析

  • 第10题:

    多选题
    在Java EE中,如果req是HttpServletRequest的实例,要通过req获取已经存在的HttpSession对象,如果不存在就创建一个HttpSession对象,下面选项中()可以实现。
    A

    req.getSession()

    B

    req.getSession(false)

    C

    req.getSession(true)

    D

    req.createSession()


    正确答案: A,C
    解析: 暂无解析

  • 第11题:

    单选题
    J2EE中,()类的()方法用于创建对话。
    A

    HttpServletRequest;getSession

    B

    HttpServletRequest;NewSession

    C

    HttpSession;newInstance

    D

    HttpSession;getSession


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    HttpServletRequest接口的()方法用于创建会话。
    A

    setSession()

    B

    getContext()

    C

    getSession()

    D

    putSession()


    正确答案: B
    解析: 暂无解析

  • 第13题:

    J2EE中,()类型的()方法用于得到会话。

    A.HttpServletRequest、getSession

    B.HttpServletResponse、newSession

    C.HtttpSession、newInstance

    D.HttpSession、getSession


    正确答案:A

  • 第14题:

    ServletContext接口的()方法用于将对象保存到Servlet上下文中。

    • A、getServetContext()
    • B、getContext()
    • C、getAttribute()
    • D、setAttribute()

    正确答案:D

  • 第15题:

    在Java Web开发中,要在服务器端查询cookie,要用到HttpServletRequest的哪个方法?()

    • A、session
    • B、getCookies
    • C、addCookie
    • D、getSession

    正确答案:B

  • 第16题:

    J2EE中,()类的()方法用于创建对话。

    • A、HttpServletRequest;getSession
    • B、HttpServletRequest;NewSession
    • C、HttpSession;newInstance
    • D、HttpSession;getSession

    正确答案:A

  • 第17题:

    如果要实现监听HTTP会话的创建,需要实现哪个接口的什么方法?()

    • A、HttpSessionListener接口的sessionDestroyed方法
    • B、HttpSessionListener接口的sessionCreated方法
    • C、HttpSessionActivationListener接口的sessionCreated方法
    • D、HttpSessionAttributeListener接口的sessionCreated方法
    • E、HttpSessionBindingListener接口的sessionCreated方法

    正确答案:B

  • 第18题:

    在Java EE中,如果req是HttpServletRequest的实例,要通过req获取已经存在的HttpSession对象,如果不存在就创建一个HttpSession对象,下面选项中()可以实现。

    • A、 req.getSession()
    • B、 req.getSession(false)
    • C、 req.getSession(true)
    • D、 req.createSession()

    正确答案:A,C

  • 第19题:

    Which retrieves all cookies sent in a given HttpSErvletRequest request?()

    • A、 request.getCookies()
    • B、 request.getAttributes()
    • C、 request.getSession ().getCookies()
    • D、 request.getSession (). GetAttributes()

    正确答案:A

  • 第20题:

    单选题
    J2EE中,哪个类的哪个方法用于创建对话?()
    A

    HttpServletRequest、getSession

    B

    HttpServletResponse、newSession

    C

    HtttpSession、newInstance

    D

    HttpSession、getSession


    正确答案: C
    解析: 暂无解析

  • 第21题:

    单选题
    下面关于HttpServletRequest接口描述错误的是()
    A

    HttpServletRequest接口中最常用的方法就是获得请求的参数

    B

    JSP中的内建对象request是一个HttpServletRequest实例

    C

    HttpServletRequest主要处理读取和写入HTTP头标

    D

    HttpServletRequest主要处理取得路径信息和标识HTTP会话,取得和设置cookies

    E

    HttpServletRequest主要处理取得输入和输出流


    正确答案: E
    解析: 暂无解析

  • 第22题:

    单选题
    Which retrieves all cookies sent in a given HttpSErvletRequest request?()
    A

     request.getCookies()

    B

     request.getAttributes()

    C

     request.getSession ().getCookies()

    D

     request.getSession (). GetAttributes()


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    如果要实现监听HTTP会话的创建,需要实现哪个接口的什么方法?()
    A

    HttpSessionListener接口的sessionDestroyed方法

    B

    HttpSessionListener接口的sessionCreated方法

    C

    HttpSessionActivationListener接口的sessionCreated方法

    D

    HttpSessionAttributeListener接口的sessionCreated方法

    E

    HttpSessionBindingListener接口的sessionCreated方法


    正确答案: B
    解析: 暂无解析