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");
第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.
第2题:
A、moved
B、removed
C、awarded
D、given
第3题:
[A] set [B] exact [C] given [D] placed
第4题:
A. any class
B. only the Target class
C. any class in the test package
D. any class that extends Target
第5题:
A.anyclass
B.onlytheTargetclass
C.anyclassinthetestpackage
D.anyclassthatextendsTarget