You are writing a JSP that includes scriptlet code to declar

题目
多选题
You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to anArrayList object. Which two JSP code snippets can you use to import these list types?()
A

<%! import java.util.*; %>

B

<%! import java.util.List;import java.util.ArrayList; %>

C

<%@ page import=’java.util.List’import=’java.util.ArrayList’ %>

D

<%@ import types=’java.util.List’types=’java.util.ArrayList’ %>

E

<%@ page import=’java.util.List,java.util.ArrayList’ %>

F

<%@ import types=’java.util.List,java.util.ArrayList’ %>

参考答案和解析
正确答案: A,F
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

You are writing a method to compress an array of bytes.The array is passed to the method in a parameter named document.You need to compress the incoming array of bytes and return the result as an array of bytes.Which code segment should you use?()

A.

B.

C.

D.


参考答案:C

第2题:

One of the guidelines in writing the C code is as follows: write code that is as clear as(15).

A.readable

B.reusable

C.possible

D.semantic


正确答案:C
解析:书写C代码的指导方针之一是编写尽可能清晰的代码。

第3题:

You are writing a method that accepts a string parameter named message.Your method must break the message parameter into individual lines of text and pass each line to a second method named Process.Which code segment should you use?()

A.

B.

C.

D.


参考答案:D

第4题:

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

第5题:

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

第6题:

Formanageabilitypurposes,youhavebeentoldtoadda"count"instancevariabletoacriticalJSP DocumentsothataJMXMBeancantrackhowfrequentthisJSPisbeinginvoked.WhichJSPcodesnippetmustyouusetodeclarethisinstancevariableintheJSPDocument?()

A.<jsp:declaration>intcount=0;<jsp:declaration>

B.<%!intcount=0;%>

C.<jsp:declaration.instance>intcount=0;.<jsp:declaration.instance>

D.<jsp:scriptlet.declaration>intcount=0;.<jsp:scriptlet.declaration>


参考答案:A

第7题:

For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippetmust you use to declare this instance variable in the JSP Document?()

  • A、<jsp:declaration>int count = 0;<jsp:declaration>
  • B、<%! int count = 0; %>
  • C、<jsp:declaration.instance>int count = 0;. <jsp:declaration.instance>
  • D、<jsp:scriptlet.declaration>int count = 0;. <jsp:scriptlet.declaration>

正确答案:A

第8题:

You are writing an application that uses SOAP to exchange data with other applications.You use a Department class that inherits from ArrayList to send objects to another application.The Department object is named dept.You need to ensure that the application serializes the Department object for transport by using SOAP.Which code should you use?()

A.

B.

C.

D.


参考答案:D

第9题:

You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to anArrayList object. Which two JSP code snippets can you use to import these list types?()

  • A、<%! import java.util.*; %>
  • B、<%! import java.util.List;import java.util.ArrayList; %>
  • C、<%@ page import=’java.util.List’import=’java.util.ArrayList’ %>
  • D、<%@ import types=’java.util.List’types=’java.util.ArrayList’ %>
  • E、<%@ page import=’java.util.List,java.util.ArrayList’ %>
  • F、<%@ import types=’java.util.List,java.util.ArrayList’ %>

正确答案:C,E

第10题:

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

更多相关问题