GivenanHttpSessionsession,aServletRequestrequest,andaServletContextcontext,whichretrievesaURLto/WEB-INF/myconfig.xmlwithinawebapplication?()A.session.getResource("/WEB-INF/myconfig.xml")B.request.getResource("/WEB-INF/myconfig.xml")C.context.getResource("

题目
GivenanHttpSessionsession,aServletRequestrequest,andaServletContextcontext,whichretrievesaURLto/WEB-INF/myconfig.xmlwithinawebapplication?()

A.session.getResource("/WEB-INF/myconfig.xml")

B.request.getResource("/WEB-INF/myconfig.xml")

C.context.getResource("/WEB-INF/myconfig.xml")

D.getClass().getResource("/WEB-INF/myconfig.xml")


相似考题
更多“GivenanHttpSessionsession,aServletRequestrequest,andaServletContextcontext,whichretrievesaURLto/WEB-INF/myconfig.xmlwithinawebapplication?() ”相关问题
  • 第1题:

    WhichpathisrequiredtobepresentwithinaWARfile?()

    A./classes

    B./index.html

    C./MANIFEST-INF

    D./WEB-INF/web.xml

    E./WEB-INF/classes

    F./WEB-INF/index.html

    G./META-INF/index.xml


    参考答案:E

  • 第2题:

    Awebapplicationcontainsatagfilecalledbeta.tagin/WEB-INF/tags/alpha.AJSPpagecalledsort.jspexistsinthewebapplicationandcontainsonlythisJSPcode:1.<%@taglibprefix="x"2.tagdir="/WEB-INF/tags/alpha"%>3.<x:beta/>Thesort.jsppageisrequested.Whichtwoaretrue?()

    A.Tagfilescanonlybeaccessedusingatagdirattribute.

    B.Thesort.jsppagetranslatessuccessfullyandinvokesthetagdefinedbybeta.tag.

    C.Thesort.jsppageproducesatranslationerrorbecauseataglibdirectivemustalwayshaveauriattribute.

    D.Tagfilescanonlybeplacedin/WEB-INF/tags,andNOTinanysubdirectoriesof/WEB-INF/tags.

    E.Thetagdirattributeinline2canbereplacedbyauriattributeifaTLDreferringtobeta.tagiscreatedandaddedtothewebapplication.


    参考答案:B, E

  • 第3题:

    YouarebuildingJSPpagesthathaveasetofmenusthatarevisiblebasedonauser’ssecurityrole.Thesemenusarehand-craftedbyyourwebdesignteam;forexample,theSalesManagerrolehasamenuinthefile/WEB-INF/html/sales-mgr-menu.html.WhichJSPcodesnippetshouldbeusedtomakethismenuvisibletotheuser?()

    A.<%if(request.isUserInRole("SalesManager")){%><%@includefile=’/WEB-INF/html/sales-mgr-menu.html’%><%}%>

    B.<jsp:iftest=’request.isUserInRole("SalesManager")’><%@includefile=’/WEB-INF/html/sales-mgr-menu.html’%></jsp:if>

    C.<%if(request.isUserInRole("SalesManager")){%>.<jsp:includefile=’/WEB-INF/html/sales-mgr-menu.html’/>.<%}%>

    D.<jsp:iftest=’request.isUserInRole("SalesManager")’><jsp:includefile=’/WEB-INF/html/sales-mgr-menu.html’/></jsp:if>


    参考答案:A

  • 第4题:

    GivenanHttpSessionsession.AServletRequestrequest.AndaServletContextcontext.WhichretrievesaURLto/WEBINF/myconfig.xmlwithinawebapplication?()

    A.session.getResource(“/WEB-INF/myconfig.xml”)

    B.request.getResource(“/WEB-INF/myconfig.xml”)

    C.context.getResource(“/WEB-INF/myconfig.xml”)

    D.getClass().getResource(“/WEB-INF/myconfig.xml”)


    参考答案:C

  • 第5题:

    AJSPpagecontainsataglibdirectivewhoseuriattributehasthevaluedbtags.WhichXMLelementwithinthewebapplicationdeploymentdescriptordefinestheassociatedTLD?()

    A.<tld><uri>dbtags</uri><location>/WEB-INF/tlds/dbtags.tld</location></tld>

    B.<taglib><uri>dbtags</uri><location>/WEB-INF/tlds/dbtags.tld</location>.</taglib>

    C.<tld>.<tld-uri>dbtags</tld-uri>.<tld-location>/WEB-INF/tlds/dbtags.tld</tld-location>.</tld>

    D.<taglib><taglib-uri>dbtags</taglib-uri><taglib-location>/WEB-INF/tlds/dbtags.tld.</taglib-location>.</taglib>


    参考答案:D