单选题A JSP page needs to perform some operations before servicing the first request. Where can this be done?()A  within a method called jspInitB  within the page directive of the JSP pageC  within a scriptlet at the top of the JSP pageD  within the  XML ele

题目
单选题
A JSP page needs to perform some operations before servicing the first request. Where can this be done?()
A

 within a method called jspInit

B

 within the page directive of the JSP page

C

 within a scriptlet at the top of the JSP page

D

 within the  XML element

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Which is a benefit of precompiling a JSP page?()

  • A、It avoids initialization on the first request.
  • B、It provides the ability to debug runtime errors in the application.
  • C、It provides better performance on the first request for the JSP page.
  • D、It avoids execution of the _jspService method on the first request.

正确答案:C

第2题:

Which JSP standard action can be used to import content from a resource called foo.jsp?()

  • A、<jsp:import file=’foo.jsp’ />
  • B、<jsp:import page=’foo.jsp’ />
  • C、<jsp:include page=’foo.jsp’ />
  • D、<jsp:include file=’foo.jsp’ />

正确答案:C

第3题:

A store was published based upon the consumer direct model.  After it was published, the store flow was changed and the APPLY PERMANENTLY option was chosen.  The store flow can no longer be changed through the WebSphere Commerce Accelerator because when the APPLY PERMANENTLYoption was chosen:()

  • A、The <flow:ifEnabled> and <flow:ifDisabled> tags were commented out of the JSP files. 
  • B、The portion of the JSP files that is enclosed within the <flow:ifDisabled> tags is removed and both the <flow:ifEnabled> and <flow:ifDisabled> tags are then removed. 
  • C、The portion of the JSP files that is enclosed within the <flow:ifDisabled> tags is commented out. 
  • D、The JSP files are renamed. 
  • E、The portion of the JSP files that is enclosed within the <flow:ifDisabled> tags is commented out and both the <flow:ifEnabled> and <flow:ifDisabled> tags are commented out.

正确答案:B

第4题:

You need to create a JavaBean object that is used only within the current JSP page. It must NOT beaccessible to any other page including those that this page might import. Which JSP standard action canaccomplish this goal?()

  • A、<jsp:useBean id=’pageBean’ type=’com.example.MyBean’ />
  • B、<jsp:useBean id=’pageBean’ class=’com.example.MyBean’ />
  • C、<jsp:makeBean id=’pageBean’ type=’com.example.MyBean’ />
  • D、<jsp:makeBean id=’pageBean’ class=’com.example.MyBean’ />

正确答案:B

第5题:

Which three occur during JSP page translation?()

  • A、 The jspInit method is called.
  • B、 The JSP page implementation class is created.
  • C、 The JSP page implementation class is compiled.
  • D、 The JSP page is validated for syntatic correctness.
  • E、 The associated tag files are validated for syntatic correctness.

正确答案:B,C,D

第6题:

A JSP page needs to perform some operations before servicing the first request. Where can this be done?()

  • A、 within a method called jspInit
  • B、 within the page directive of the JSP page
  • C、 within a scriptlet at the top of the JSP page
  • D、 within the  XML element

正确答案:A

第7题:

You are creating a new JSP page and you need to execute some code that acts when the page is firstexecuted, but only once. Which three are possible mechanisms for performing this initialization code?()

  • A、In the init method.
  • B、In the jspInit method.
  • C、In the constructor of the JSP’s Java code.
  • D、In a JSP declaration, which includes an initializer block.
  • E、In a JSP declaration, which includes a static initializer block.

正确答案:B,D,E

第8题:

A JSP page needs to instantiate a JavaBean to be used by only that page. Which two jsp:useBean attributes must be used to access this attribute in the JSP page?()

  • A、 id
  • B、 type
  • C、 name
  • D、 class
  • E、 scope
  • F、 create

正确答案:A,D

第9题:

You have created a JSP that includes instance variables and a great deal of scriptlet code. Unfortunately,after extensive load testing, you have discovered several race conditions in your JSP scriptlet code. To fixthese problems would require significant recoding, but you are already behind schedule. Which JSP codesnippet can you use to resolve these concurrency problems?()

  • A、<%@ page isThreadSafe=’false’ %>
  • B、<%@ implements SingleThreadModel %>
  • C、<%! implements SingleThreadModel %>
  • D、<%@ page useSingleThreadModel=’true’ %>
  • E、<%@ page implements=’SingleThreadModel’ %>

正确答案:A

第10题:

You have built your own light-weight templating mechanism. Your servlets, which handle each request,dispatch the request to one of a small set of template JSP pages. Each template JSP controls the layout ofthe view by inserting the header, body, and footer elements into specific locations within the template page.The URLs for these three elements are stored in request scoped variables called, headerURL, bodyURL,and footerURL, respectively. These attribute names are never used for other purposes. Which JSP codesnippet should be used in the template JSP to insert the JSP content for the body of the page?()

  • A、<jsp:insert page=’${bodyURL}’ />
  • B、<jsp:insert file=’${bodyURL}’ />
  • C、<jsp:include page=’${bodyURL}’ />
  • D、<jsp:include file=’${bodyURL}’ />
  • E、<jsp:insert page=’<%= bodyURL %>’ />

正确答案:C

更多相关问题