Given the JSP code: <% request.setAttribute("foo", "bar"); %>and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()
第1题:
Youarebuildingyourownlayoutmechanismbyincludingdynamiccontentforthepage’sheaderandfootersections.Thefooterisalwaysstatic,buttheheadergeneratesthe<title>tagthatrequiresthepagenametobespecifieddynamicallywhentheheaderisimported.WhichJSPcodesnippetperformstheimportoftheheadercontent?()
A.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:include>
B.<jsp:importpage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:import>
C.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:include>
D.<jsp:importpage=’/WEB-INF/jsp/header.jsp’>.<jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:import>
第2题:
Given:11.<servlet>12.<servlet-name>catalog</servlet-name>13.<jsp-file>/catalogTemplate.jsp</jsp-file>14.<load-on-startup>10</load-on-startup>15.</servlet>Whichtwoaretrue?()
A.Line13isnotvalidforaservletdeclaration.
B.Line14isnotvalidforaservletdeclaration.
C.Oneinstanceoftheservletwillbeloadedatstartup.
D.Teninstancesoftheservletwillbeloadedatstartup.
E.Theservletwillbereferencedbythenamecataloginmappings.
第3题:
在J2EE中,在aa.jsp中有行代码:<%request.setAttribute("Co.","jb-aptech");%>在bb.jsp中有行代码:<%out.println((String)request.getAttribute("Co."));%>为了使得在bb.jsp中的如上代码可以显示jb-aptech”,可以使用()方法。
A.在aa.jsp中使用<formmethod=postaction="bb.jsp">把请求提交到bb.jsp
B.在aa.jsp中使用<jsp:forwardfile="bb.jsp"/>把页面重定向到bb.jsp
C.在aa.jsp中使用<%response.sendRedirect("bb.jsp");%>把页面重定向到bb.jsp
D.在aa.jsp中使用<%@includefile="bb.jsp"%>包含页面bb.jsp
E.在aa.jsp中使用<%config.getServletContext().getRequestDispatcher("/bb.jsp").forward(request,response);%>把页面重定向到bb.jsp
第4题:
Given the element from the web application deployment descriptor:
第5题:
在J2EE中,在aa.jsp中有行代码: <%><% request.setAttribute("Co.","jb-aptech"); %> 在bb.jsp中有行代码: <% out.println((String)request.getAttribute("Co.")); %> <%> 为了使得在bb.jsp中的如上代码可以显示“jb-aptech”,可以使用()方法。
第6题:
A.<%!inti;%>
B.<%=inti;%>
C.<jsp:expr>inti;</jsp:expr>
D.<jsp:scriptlet>inti;</jsp:scriptlet>
E.<jsp:declaration>inti;</jsp:declaration>
第7题:
A.<jsp:importfile=’foo.jsp’/>
B.<jsp:importpage=’foo.jsp’/>
C.<jsp:includepage=’foo.jsp’/>
D.<jsp:includefile=’foo.jsp’/>
第8题:
JSP EL表达式的语法为( )
A、!JSP expression
B、@{JSP expression}
C、${JSP expression}
D、#{JSP expression}
第9题:
Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()
第10题:
Which JSP standard action can be used to import content from a resource called foo.jsp?()