SCWCD(310-083)

单选题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’

题目
单选题
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’ />

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

第1题:

JSP中JavaBean是通过指令标签()来访问的。

  • A、〈%@ page%〉
  • B、〈jsp:useBean〉
  • C、〈jsp:setProperty〉
  • D、〈jsp:getProperty〉

正确答案:B

第2题:

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

第3题:

在J2EE中,在JSP中想要使用JavaBean:mypackage.mybean,则一下写法正确的是() 

  • A、<jsp:usebean id=”mybean” scope=”page” class=”mypackage.mybean”/> 
  • B、<jsp:useBean class=”mypackage.mybean.class”/> 
  • C、<jsp:usebean id=”mybean” class=”mypackage.mybean”/> 
  • D、<jsp:useBean id=”mybean” class=”mypackage..mybean”>

正确答案:D

第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 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

第6题:

在J2EE中,在JSP中想要使用JavaBean:mypackage.mybean,则以下写法正确的是()。

  • A、<jsp:usebean id=”mybean” scop=”page” class=”mypackage.mybean”/> 
  • B、<jsp:useBean class=”mypackage.mybean.class”/> 
  • C、<jsp:usebean id=”mybean” class=”mypackage.mybean”/> 
  • D、<jsp:useBean id=”mybean” class=”mypackage.mybean”/>

正确答案:D

第7题:

In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored asa List object in the catalog attribute of the webapp’s ServletContext object.  Which scriptlet code snippetgives you access to the catalog object?()

  • A、<% List catalog = config.getAttribute("catalog"); %>
  • B、<% List catalog = context.getAttribute("catalog"); %>
  • C、<% List catalog = application.getAttribute("catalog"); %>
  • D、<% List catalog = servletContext.getAttribute("catalog"); %>

正确答案:C

第8题:

在JSP页面中,正确引入JavaBean的是()  

  • A、<%jsp: useBean id =”myBean” scope =”page” class=”pkg.MyBean” %>  
  • B、<jsp: useBean name=”myBean” scope =”page” class=”pkg.MyBean” >  
  • C、<jsp: useBean id =”myBean” scope =”page” class=”pkg.MyBean” /> 
  • D、<jsp: useBean name=”myBean” scope =”page” class=”pkg.MyBean” />

正确答案:C

第9题:

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

第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

更多相关问题