单项选择题

A.Attheendoftheusecase,youwanttoclearoutthissetofattributesfromthesessionobject.Assumethatthisstaticvariableholdsthissetofattributenames:201.privatestaticfinalSetUSE_CASE_ATTRS;202.static{203.USE_CASE_ATTRS.add("customerOID");204.USE_CASE_ATTRS.add("custMgrBean");205.USE_CASE_ATTRS.add("orderOID");206.USE_CASE_ATTRS.add("orderMgrBean");207.}Whichcodesnippetdeletestheseattributesfromthesessionobject?()
A.session.removeAll(USE_CASE_ATTRS);
B.for(Stringattr:USE_CASE_ATTRS){session.remove(attr);}
C.for(Stringattr:USE_CASE_ATTRS){session.removeAttribute(attr);}
D.for(Stringattr:USE_CASE_ATTRS){session.deleteAttribute(attr);}
E.session.deleteAllAttributes(USE_CASE_ATTRS);
相关考题

单项选择题 Whichthe statementistrueaboutwebcontainersessionmanagement()?

单项选择题 SqueakyBeansInc.hiredanoutsideconsultanttodeveloptheirwebapplication.Tofinishthejobquickly,theconsultantcreatedseveraldozenJSPpagesthatdirectlycommunicatewiththedatabase.TheSqueakybusinessteamhassincepurchasedasetofbusinessobjectstomodeltheirsystem,andtheSqueakydeveloperchargedwithmaintainingthewebapplicationmustnowrefactoralltheJSPstoworkwiththenewsystem.Whichpatterncanthedeveloperusetosolvethisproblem?()A.TransferObjectB.ServiceLocatorC.InterceptingFilterD.BusinessDelegate

单项选择题 Youhavecreatedaservletthatgeneratesweathermaps.Thedataforthesemapsiscalculatedbyaremotehost.TheIPaddressofthishostisusuallystable,butoccasionallydoeshavetochangeasthecorporatenetworkgrowsandchanges.ThisIPaddressusedtobehardcoded,butafterthefifthchangetotheIPaddressintwoyears,youhavedecidedthatthisvalueshouldbedeclaredinthedeploymentdescriptorsoyoudoNOThavetherecompilethewebapplicationeverytimetheIPaddresschanges.Whichdeploymentdescriptorsnippetaccomplishesthisgoal?()

单项选择题 GivenaportionofavalidJavaEEwebapplication’sdirectorystructure:MyApp||--File1.html||--Directory1||--File2.html||--META-INF|--File3.htmlYouwanttoknowwhetherFile1.html,File2.html,and/orFile3.htmlwillbedirectlyaccessiblebyyourwebclient’sbrowsers.Whichstatementistrue?()A.Allthreefilesaredirectlyaccessible.B.OnlyFile1.htmlisdirectlyaccessible.C.OnlyFile2.htmlisdirectlyaccessible.D.OnlyFile3.htmlisdirectlyaccessible.E.OnlyFile1.htmlandFile2.htmlaredirectlyaccessible.

单项选择题 Adeveloperisdesigningawebapplicationthatmustsupportmultipleinterfaces,including:?anXMLwebserviceforB2B?HTMLforweb-basedclients?WMLforwirelesscustomersWhichdesignpatternprovidesasolutionforthisproblem?()A.SessionFaçadeB.BusinessDelegateC.DataAccessObjectD.Model-View-ControllerE.ChainofResponsibility

单项选择题 GiventhisfragmentfromaJavaEEdeploymentdescriptor:341.<error-page>342.<exception-type>java.lang.Throwable</exception-type>343.<location>/mainError.jsp</location>344.</error-page>345.<error-page>346.<exception-type>java.lang.ClassCastException</exception-type>347.<location>/castError.jsp</location>348.</error-page>IfthewebapplicationassociatedwiththefragmentabovethrowsaClassCastException.Whichstatementistrue?()A.Thedeploymentdescriptorisinvalid.B.ThecontainerinvokesmainError.jsp.C.ThecontainerinvokescastError.jsp.D.NeithermainError.jspnorcastError.jspisinvoked.

单项选择题 Giventhefollowingsixmethodnames:(1)addListener(2)addMouseListener(3)setMouseListener(4)deleteMouseListener(5)removeMouseListener(6)registerMouseListenerHowmanyofthesemethodnamesfollowJavaBeanListenernamingrules?()A.1B.2C.3D.4E.5

判断题 购买保险是一种回避风险的应对策略。()

单项选择题 Whichelementofawebapplicationdeploymentdescriptorelementisrequired?()

单项选择题 Whichisthe true choiceaboutthewebcontainerrequestprocessingmodel()?

单项选择题 Whichpath,relativetoawebapplication’sroot,identifiesthewebapplication’sdeploymentdescriptor?()

单项选择题 Whichthe JSTLcodesnippetcanbeusedtoimportcontentfromanotherwebresource?()

单项选择题 JavaSEJDK中类库java.text的用途是哪项?()

单项选择题 Given:10.publicvoidservice(ServletRequestrequest,11.ServletResponseresponse){12.ServletInputStreamsis=13.//insertcodehere14.}Whichretrievesthebinaryinputstreamonline13?()

单项选择题 Whichelementofthewebapplicationdeploymentdescriptordefinestheservletclassassociatedwithaservletinstance?()

单项选择题 AssumeaJavaBeancom.example.GradedTestBeanexistsandhastwoattributes.Theattributenameisoftypejava.lang.Stringandtheattributescoreisoftypejava.lang.Integer.Anarrayofcom.example.GradedTestBeanobjectsisexposedtothepageinarequest-scopedattributecalledresults.Additionally,anemptyjava.util.HashMapcalledresultMapisplacedinthepagescope.AJSPpageneedstoaddthefirstentryinresultstoresultMap,storingthenameattributeofthebeanasthekeyandthescoreattributeofthebeanasthevalue.WhichcodesnippetofJSTLcodesatisfiesthisrequirement?()

单项选择题 Inyourwebapplication,youneedtoexecuteablockofcodewheneverthesessionobjectisfirstcreated.Whichdesignwillaccomplishthisgoal?()

单项选择题 InaJSP-centricwebapplication,youneedtocreateacatalogbrowsingJSPpage.ThecatalogisstoredasaListobjectinthecatalogattributeofthewebapp’sServletContextobject.Whichscriptletcodesnippetgivesyouaccesstothecatalogobject?()A.<%Listcatalog=config.getAttribute("catalog");%>B.<%Listcatalog=context.getAttribute("catalog");%>C.<%Listcatalog=application.getAttribute("catalog");%>D.<%Listcatalog=servletContext.getAttribute("catalog");%>

单项选择题 AdeveloperwantstoouseELtoinvokea.Whichisalwaystrue?()

单项选择题 Adeveloperhasusedthiscodewithinaservlet:62.if(request.isUserInRole("vip")){63.//VIP-relatedlogichere64.}Whatelsemustthedeveloperdotoensurethattheintendedsecuritygoalisachieved?()