在JSP页面中,保存数据的范围由小到大依次是()。A、pageContext,request,application,sessionB、pageContext,application,session,requestC、pageContext,request,session,applicationD、pageContext,session,request,application

题目

在JSP页面中,保存数据的范围由小到大依次是()。

  • A、pageContext,request,application,session
  • B、pageContext,application,session,request
  • C、pageContext,request,session,application
  • D、pageContext,session,request,application

相似考题
更多“在JSP页面中,保存数据的范围由小到大依次是()。A、pageContext,request,application,sessionB、pageContext,application,session,requestC、pageContext,request,session,applicationD、pageContext,session,request,application”相关问题
  • 第1题:

    某JSP中有如下代码:

    < %

    pageContext.setAttribute( “a” , ” page ” );

    request.setAttribute( “a” , ” request ” );

    session.setAttribute( “a” , ” session ” );

    application.setAttribute( “a” , ” application ” );

    % >

    有:${a}

    则显示结果为:

    A.page

    B.request

    C.session

    D.application


    正确答案:A

  • 第2题:

    在Sturts应用中,能在()范围内共享数据。

    A.共享数据的范围page,request,session,application

    B.共享数据的范围request,session,application

    C.共享数据的范围session,application

    D.共享数据的范围session


    参考答案:A

  • 第3题:

    在Sturts应用中,能在()范围内共享数据。

    • A、共享数据的范围page,request,session,application
    • B、共享数据的范围request,session,application
    • C、共享数据的范围session,application
    • D、共享数据的范围session

    正确答案:A

  • 第4题:

    A developer wants to make a name attribute available to all servlets associated with a particular user,across multiple requests from that user, from the same browser instance. Which two provide this capability from within a tag handler?()

    • A、pageContext.setAttribute("name", theValue)
    • B、pageContext.setAttribute("name", getSession())
    • C、pageContext.getRequest().setAttribute("name", theValue)
    • D、pageContext.getSession().setAttribute("name", theValue)
    • E、pageContext.setAttribute("name", theValue,PageContext.PAGE_SCOPE)
    • F、pageContext.setAttribute("name", theValue,PageContext.SESSION_SCOPE)

    正确答案:D,F

  • 第5题:

    下面关于pageContext对象说法中正确的是()

    • A、pageContext对象为JSP页面包装页面的上下文。
    • B、pageContext对象创建和初始化都是由容器来完成的
    • C、getRequest()方法返回当前的request对象
    • D、getSession()方法返回当前页面的session对象。
    • E、removeAttribute()方法用来删除默认页面范围或特定范围之中的已命名对象。

    正确答案:A,B,C,D,E

  • 第6题:

    在jsp中作用域由小到大的组合是()

    • A、request page session application
    • B、page request session application
    • C、pageContext request session application
    • D、pageScope request sessionScope applicationScope

    正确答案:C

  • 第7题:

    Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp. Which two techniques can you use to accomplish this goal?()

    • A、Add attributes to the session object.
    • B、Add attributes on the request object.
    • C、Add parameters to the request object.
    • D、Use the pageContext object to add request attributes.
    • E、Add parameters to the JSP’s URL when generating the request dispatcher.

    正确答案:B,E

  • 第8题:

    Which EL expression evaluates to the request URI?()

    • A、${requestURI}
    • B、${request.URI}
    • C、${request.getURI}
    • D、${request.requestURI}
    • E、${requestScope.requestURI}
    • F、${pageContext.request.requestURI}

    正确答案:F

  • 第9题:

    单选题
    Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()
    A

     pageContext.getAttribute(“foo”);

    B

     getPageContext().getAttribute(“foo”);

    C

     pageContext.getApplicationScope(“foo”);

    D

     pageContext.getAttribute(“foo”,pageContext.APPLICATION_SCOPE).getAttribute(“foo”);

    E

     getPageContext().getScope(pageContext.APPLICATION_SCOPE).getAttribute(“foo”);


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

  • 第10题:

    单选题
    下面关于JSP作用域对象的说法错误的是()
    A

      request对象可以得到请求中的参数

    B

      session对象可以保存用户信息

    C

      application对象可以被多个应用共享

    D

      作用域范围从小到达是request、session、application


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

  • 第11题:

    单选题
    在JSP页面中,保存数据的范围由小到大依次是()。
    A

    pageContext,request,application,session

    B

    pageContext,application,session,request

    C

    pageContext,request,session,application

    D

    pageContext,session,request,application


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

  • 第12题:

    多选题
    下面关于pageContext对象说法中正确的是()
    A

    pageContext对象为JSP页面包装页面的上下文。

    B

    pageContext对象创建和初始化都是由容器来完成的

    C

    getRequest()方法返回当前的request对象

    D

    getSession()方法返回当前页面的session对象。

    E

    removeAttribute()方法用来删除默认页面范围或特定范围之中的已命名对象。


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

  • 第13题:

    ASP提供的两个可用来存储变量的内建对象是______。

    A.Request对象和Application对象

    B.Session对象和Request对象

    C.Session对象和Application对象

    D.Session对象和Cookie对象


    正确答案:C

  • 第14题:

    如果只希望在多个页面间共享数据,可以使用()作用域。

    • A、request,session
    • B、application,session
    • C、request,application
    • D、pageContext,request

    正确答案:A

  • 第15题:

    Given: 3.public class MyTagHandler extends TagSupport { 4.public int doStartTag() { 5.// insert code here 6.// return an int 7.} 8.// more code here ... 18.} There is a single attribute foo in the session scope. Which three code fragments,inserted independently atline 5,return the value of the attribute?()

    • A、Object o = pageContext.getAttribute("foo");
    • B、Object o = pageContext.findAttribute("foo");
    • C、Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);
    • D、HttpSession s = pageContext.getSession();Object o = s.getAttribute("foo");

    正确答案:B,C,D

  • 第16题:

    Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()

    • A、 pageContext.getAttribute(“foo”);
    • B、 getPageContext().getAttribute(“foo”);
    • C、 pageContext.getApplicationScope(“foo”);
    • D、 pageContext.getAttribute(“foo”,pageContext.APPLICATION_SCOPE).getAttribute(“foo”);
    • E、 getPageContext().getScope(pageContext.APPLICATION_SCOPE).getAttribute(“foo”);

    正确答案:D

  • 第17题:

    按作用域从大到小排列正确的是 ()

    • A、  application page request  response
    • B、  session page request  application
    • C、  public  application session request
    • D、  application session  request  page

    正确答案:D

  • 第18题:

    以下有关JSP内置对象的说法错误的是()。

    • A、request对象可以得到请求中的参数
    • B、session对象可以保存用户信息
    • C、application对象可以被多个应用共享
    • D、作用域范围从小到达是request、session、application

    正确答案:C

  • 第19题:

    Given the JSP code: <% request.setAttribute("foo", "bar"); %>and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()

    • A、String x = (String) pageContext.getAttribute("foo")
    • B、String x = (String) pageContext.getRequestScope("foo")
    • C、It is NOT possible to access the pageContext object from within doStartTag
    • D、String x = (String) pageContext.getRequest().getAttribute("foo")
    • E、String x = (String) pageContext.getAttribute("foo", PageContext.ANY_SCOPE)

    正确答案:D

  • 第20题:

    单选题
    在Struts应用中,能在()范围内共享数据。
    A

    共享数据的范围page,request,session,application

    B

    共享数据的范围request,session,application

    C

    共享数据的范围session,application

    D

    共享数据的范围session


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

  • 第21题:

    单选题
    按作用域从大到小排列正确的是 ()
    A

      application page request  response

    B

      session page request  application

    C

      public  application session request

    D

      application session  request  page


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

  • 第22题:

    多选题
    Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp. Which two techniques can you use to accomplish this goal?()
    A

    Add attributes to the session object.

    B

    Add attributes on the request object.

    C

    Add parameters to the request object.

    D

    Use the pageContext object to add request attributes.

    E

    Add parameters to the JSP’s URL when generating the request dispatcher.


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

  • 第23题:

    单选题
    在jsp中作用域由小到大的组合是()
    A

    request page session application

    B

    page request session application

    C

    pageContext request session application

    D

    pageScope request sessionScope applicationScope


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