Given:3.publicclassMyTagHandlerextendsTagSupport{4.publicintdoStartTag(){5.//insertcodehere6.//returnanint7.}8.//morecodehere...18.}Thereisasingleattributefoointhesessionscope.Whichthreecodefragments,insertedindependentlyatline5,returnthevalueoftheattribu

题目

Given:3.publicclassMyTagHandlerextendsTagSupport{4.publicintdoStartTag(){5.//insertcodehere6.//returnanint7.}8.//morecodehere...18.}Thereisasingleattributefoointhesessionscope.Whichthreecodefragments,insertedindependentlyatline5,returnthevalueoftheattribute?()

A.Objecto=pageContext.getAttribute("foo");

B.Objecto=pageContext.findAttribute("foo");

C.Objecto=pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);

D.HttpSessions=pageContext.getSession();Objecto=s.getAttribute("foo");


相似考题
参考答案和解析
参考答案:B, C, D
更多“Given:3.publicclassMyTagHandlerextendsTagSupport{4.publicintdoStartTag(){5.//insertcodeher ”相关问题
  • 第1题:

    Given:3.classMyServletextendsHttpServlet{4.publicvoiddoPut(HttpServletRequestreq,HttpServletResponseresp)throwsServletException,IOException{5.//servletcodehere...26.}27.}IftheDDcontainsasinglesecurityconstraintassociatedwithMyServletanditsonly<httpmethod>tagsand<auth-constraint>tagsare:<http-method>GET</http-method><http-method>PUT</http-method><auth-constraint>Admin</auth-constraint>Whichfourrequestswouldbeallowedbythecontainer?()

    A.AuserwhoseroleisAdmincanperformaPUT.

    B.AuserwhoseroleisAdmincanperformaGET.

    C.AuserwhoseroleisAdmincanperformaPOST.

    D.AuserwhoseroleisMembercanperformaPUT.

    E.AuserwhoseroleisMembercanperformaPOST.

    F.AuserwhoseroleisMembercanperformaGET.


    参考答案:A, B, C, E

  • 第2题:

    He was() from his position as the president of the university.

    A、moved

    B、removed

    C、awarded

    D、given


    参考答案:B

  • 第3题:

    [A] set [B] exact [C] given [D] placed


    正确答案:A

  • 第4题:

    Given:What can directly access and change the value of the variable name?()

    A. any class

    B. only the Target class

    C. any class in the test package

    D. any class that extends Target


    参考答案:C

  • 第5题:

    Given:1.packagetest;2.3.classTarget{4.publicStringname="hello";5.}Whatcandirectlyaccessandchangethevalueofthevariablename?()

    A.anyclass

    B.onlytheTargetclass

    C.anyclassinthetestpackage

    D.anyclassthatextendsTarget


    参考答案:C