单项选择题

A.request.addCookie(“username”.“joe”)
B.request.setCookie(“username,“joe”)
C.response.addCookie(username”,“joe”))
D.request.addHeader(newCookie(“username”,“joe”))
E.request.addCookie(newCookie(“username”,“joe”))
F.response.addCookie(newCookie(“username”,“joe”))
G.response.addHeader(newCookie(“username”,“joe”))
相关考题

单项选择题 GiventhisfragmentfromaJavaEEdeploymentdescriptor:124.<welcome-file>beta.html</welcome-file>125.<welcome-file>alpha.html</welcome-file>Andthisrequestfromabrowser:http://www.sun.com/SCWCDtestApp/registerWhichstatementiscorrect,whenthecontainerreceivesthisrequest?()A.ThisdeploymentdescriptorisNOTvalid.B.Thecontainerfirstlooksintheregisterdirectoryforbeta.html.C.Thecontainerfirstlooksintheregisterdirectoryforalpha.html.D.Thecontainerfirstlooksforaservletmappinginthedeploymentdescriptor.

单项选择题 Youarebuildingadatingwebsite.Theclient’sdateofbirthiscollectedalongwithlotsofotherinformation.YouhavecreatedanELfunctionwiththesignature:calcAge(java.util.Date):intanditisassignedtothename,age,inthenamespace,funct.InoneofyourJSPsyouneedtoprintaspecialmessagetoclientswhoareyoungerthan25.WhichELcodesnippetwillreturntrueforthiscondition?()A.${calcAge(client.birthDate)<25}B.${calcAge[client.birthDate]<25}C.${funct:age(client.birthDate)<25}D.${funct:age[client.birthDate]<25}E.${funct:calcAge(client.birthDate)<25}

单项选择题 WhichstatementistrueifthedoStartTagmethodreturnsEVAL_BODY_BUFFERED?()

单项选择题 WhichbasicauthenticationtypeisoptionalforaJ2EE1.4compliantwebcontainer?()

单项选择题 GivenaFilterclassdefinitionwiththismethod:21.publicvoiddoFilter(ServletRequestrequest,22.ServletResponseresponse,23.FilterChainchain)24.throwsServletException,IOException{25.//insertcodehere26.}Whichshouldyouinsertatline25toproperlyinvokethenextfilterinthechain,orthetargetservletiftherearenomorefilters?()A.chain.forward(request,response);B.chain.doFilter(request,response);C.request.forward(request,response);D.request.doFilter(request,response);

单项选择题 GivenanELfunctionfoo,innamespacefunc,thatrequiresalongasaparameterandreturnsaMap,whichtwoarevalidinvocationsoffunctionfoo?()

单项选择题 Giventhatlogin.getName()returnsajava.lang.StringvalueandgiventheJSPcode:WelcomeWhichisequivalent?()

单项选择题 Whichwilldeclareamethodthatisavailabletoallmembersofthesamepackageandbereferencedwithoutaninstanceoftheclass?()

单项选择题 GivenanHttpServletRequestrequest,whichretrievesanobjectoftypeAccountwithanIdof“account”?()

单项选择题 Given1.publicclassFoo{2.publicstaticvoidmain(String[]args)}3.try{return;}4.finally{Syste.out.printIn(Finally”);}5.}6.}Whatistheresult()?

单项选择题 Whatisthenumericalrangeofchar?()

单项选择题 Whichmechanismrequirestheclienttoprovideitspublickeycertificate?()

单项选择题 WhichretrievesallcookiessentinagivenHttpSErvletRequestrequest?()

单项选择题 WhichHTTPmethodhasthecharacteristicthatmultipleindentialrequestsmayproducesideeffectbeyondthoseofasinglerequest()?

单项选择题 Everypageofyourwebsitemustincludeacommonsetofnavigationmenusatthetopofthepage.ThismenuisstaticHTMLandchangesfrequently,soyouhavedecidedtouseJSP’sstaticimportmechanism.WhichJSPcodesnippetaccomplishesthisgoal?()A.<%@importfile=’/common/menu.html’%>B.<%@pageimport=’/common/menu.html’%>C.<%@importpage=’/common/menu.html’%>D.<%@includefile=’/common/menu.html’%>E.<%@pageinclude=’/common/menu.html’%>

单项选择题 Adeveloperisdesigningthepresentationtierforawebapplicationwhichrequiresacentralizedrequesthandlingtocompletecommonprocessingrequiredbyeachrequest.Whichdesignpatternprovidesasolutiontothisproblem?()

单项选择题 YouhaveasimplewebapplicationthathasasingleFrontControllerservletthatdispatchestoJSPstogenerateavarietyofviews.Severaloftheseviewsrequirefurtherdatabaseprocessingtoretrievethe necessaryorderobjectusingtheorderIDrequestparameter.Todothisadditionalprocessing,youpasstherequestfirsttoaservletthatismappedtotheURLpattern/WEBINF/retreiveOrder.dointhedeploymentdescriptor.Thisservlettakestworequestparameters,theorderIDandthejspURL.IthandlesthedatabasecallstoretrieveandbuildthecomplexorderobjectsandthenitdispatchestothejspURL.WhichcodesnippetintheFrontControllerservletdispatchestherequesttotheorderretrievalservlet?()

单项选择题 Adeveloperisdesigningawebapplicationthatmakesmanyfine-grainedremotedatarequestsforeachclientrequest.Duringtesting,thedeveloperdiscoversthatthevolumeofremoterequestssignificantlydegradesperformanceoftheapplication.Whichdesignpatternprovidesasolutionforthisproblem?()A.FlyweightB.TransferObjectC.ServiceLocatorD.DispatcherViewE.BusinessDelegateF.Model-View-Controller

单项选择题 Giventhewebapplicationdeploymentdescriptorelements:11.<filter>12.<filter-name>ParamAdder</filter-name>13.<filter-class>com.example.ParamAdder</filter-class>14.</filter>...24.<filter-mapping>25.<filter-name>ParamAdder</filter-name>26.<servlet-name>MyServlet</servlet-name>27.<!--insertelementhere-->28.</filter-mapping>Whichelement,insertedatline27,causestheParamAdderfiltertobeappliedwhenMyServletisinvokedbyanotherservletusingtheRequestDispatcher.includemethod?()A.<include/>B.<dispatcher>INCLUDE</dispatcher>C.<dispatcher>include</dispatcher>D.<filter-condition>INCLUDE</filter-condition>E.<filter-condition>include</filter-condition>

单项选择题 Youhaveausecaseinyourwebapplicationthataddsseveralsession-scopedattributes.Attheendoftheusecase,oneoftheseobjects,themanagerattribute,isremovedandthenitneedstodecidewhichoftheothersession-scopedattributestoremove.Howcanthisgoalbeaccomplished?()A.TheobjectofthemanagerattributeshouldimplementtheHttpSessionBindingListeneranditshouldcall theremoveAttributemethodontheappropriatesessionattributes.B.TheobjectofthemanagerattributeshouldimplementtheHttpSessionListeneranditshouldcallthe removeAttributemethodontheappropriatesessionattributes.C.TheobjectofthemanagerattributeshouldimplementtheHttpSessionBindingListeneranditshouldcall thedeleteAttributemethodontheappropriatesessionattributes.D.TheobjectofthemanagerattributeshouldimplementtheHttpSessionListeneranditshouldcallthe deleteAttributemethodontheappropriatesessionattributes.