网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
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?() 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) ” 相关考题
考题 假设在helloapp应用中有一个Javabean文件HelloServlet,它位于org.javathinker包下,那么这个bean的class文件应该放在什么目录下? ( )A.helloapp/HelloServlet.classB.helloapp/WEB-INF/HelloServlet.classC.helloapp/WEB-INF/classes/HelloServlet.classD.helloapp/WEB-INF/classes/org/javathinker/HelloServlet.class

考题 JavaBean文件应保存在()。 A、Web服务器的发布目录下B、WEB-INF\classes下C、WEB-INF下D、webapps下

考题 Youarebuildingyourownlayoutmechanismbyincludingdynamiccontentforthepage’sheaderandfootersections.Thefooterisalwaysstatic,buttheheadergeneratesthetitletagthatrequiresthepagenametobespecifieddynamicallywhentheheaderisimported.WhichJSPcodesnippetperformstheimportoftheheadercontent?()A.jsp:includepage=’/WEB-INF/jsp/header.jsp’jsp:paramname=’pageName’value=’WelcomePage’//jsp:includeB.jsp:importpage=’/WEB-INF/jsp/header.jsp’jsp:paramname=’pageName’value=’WelcomePage’//jsp:importC.jsp:includepage=’/WEB-INF/jsp/header.jsp’jsp:attributename=’pageName’value=’WelcomePage’/./jsp:includeD.jsp:importpage=’/WEB-INF/jsp/header.jsp’.jsp:attributename=’pageName’value=’WelcomePage’/./jsp:import

考题 Inwhichtwowebapplicationdirectoriescandependentclassesandlibrariesbelocated?() A./WEB-INF/libasaJARfileB./META-INF/libasaJARfileC./classesascompiledclassfilesD./WEB-INF/libascompiledclassfilesE./WEB-INF/classesascompiledclassfilesF./META-INF/classesascompiledclassfiles

考题 WhichpathisrequiredtobepresentwithinaWARfile?() A./classesB./index.htmlC./MANIFEST-INFD./WEB-INF/web.xmlE./WEB-INF/classesF./WEB-INF/index.htmlG./META-INF/index.xml

考题 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”)

考题 Awebapplicationcontainsatagfilecalledbeta.tagin/WEB-INF/tags/alpha.AJSPpagecalledsort.jspexistsinthewebapplicationandcontainsonlythisJSPcode:1.%@taglibprefix=x2.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.

考题 AJSPpagecontainsataglibdirectivewhoseuriattributehasthevaluedbtags.WhichXMLelementwithinthewebapplicationdeploymentdescriptordefinestheassociatedTLD?() A.tlduridbtags/urilocation/WEB-INF/tlds/dbtags.tld/location/tldB.tagliburidbtags/urilocation/WEB-INF/tlds/dbtags.tld/location./taglibC.tld.tld-uridbtags/tld-uri.tld-location/WEB-INF/tlds/dbtags.tld/tld-location./tldD.taglibtaglib-uridbtags/taglib-uritaglib-location/WEB-INF/tlds/dbtags.tld./taglib-location./taglib

考题 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:ifC.%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