<jsp:declaration>int count = 0;<jsp:declaration>
<%! int count = 0; %>
<jsp:declaration.instance>int count = 0;. <jsp:declaration.instance>
<jsp:scriptlet.declaration>int count = 0;. <jsp:scriptlet.declaration>
第1题:
For debugging purposes, you need to record how many times a given JSP is invoked before the user’ssession has been created. The JSP’s destroy method stores this information to a database. Which JSPcode snippet keeps track of this count for the lifetime of the JSP page?()
第2题:
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?()
第3题:
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?()
第4题:
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?()
第5题:
Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp. Which two techniques can you use to accomplish this goal?()
第6题:
You work in a company which uses SQL Server 2008. You are the administrator of the company database. In your company there is a server which contains a default SQL Server 2005 instance. For a new application, you have to install a SQL Server 2008 instance on the server. Your company CIO assigns a task to you. You must make sure that the respective certified third-party applications have access to both database instances. You have to achieve this goal without changing the existing application environments. So what should you do to achieve this by using as little database administrative effort as possible?()
第7题:
Store the data in a public instance variable in the servlet.
Add an attribute to the request object before using the request dispatcher.
Add an attribute to the context object before using the request dispatcher.
This CANNOT be done as the tag handler has no means to extract this data.
第8题:
In the init method.
In the jspInit method.
In the constructor of the JSP’s Java code.
In a JSP declaration, which includes an initializer block.
In a JSP declaration, which includes a static initializer block.
第9题:
<%@ page contentType=’application/javascript’ %>
<jsp:page contentType='application/javascript' />
<jsp:document contentType='application/javascript' />
No declaration is needed because the web form XHTML page already declares the MIME type of the /scripts/screenFunctions.jsp file in the <script> tag.
第10题:
<%! int count = 0; %><% if ( request.getSession(false) == null ) count++; %>
<%@ int count = 0; %>. <% if ( request.getSession(false) == null ) count++; %>
<% int count = 0;. if ( request.getSession(false) == null ) count++; %>
<%@ int count = 0;. if ( request.getSession(false) == null ) count++; %>
<%! int count = 0;. if ( request.getSession(false) == null ) count++; %>
第11题:
<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:insert>
<jsp:include page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>
<jsp:include file=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>
<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:insert>
<jsp:include page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:include>
第12题:
<jsp:declaration>int count = 0;<jsp:declaration>
<%! int count = 0; %>
<jsp:declaration.instance>int count = 0;. <jsp:declaration.instance>
<jsp:scriptlet.declaration>int count = 0;. <jsp:scriptlet.declaration>
第13题:
You have been assigned to manage a set of databases. The previous DBA did not leave you notes regarding the structure of each of the databases. While analyzing an instance, you notice that the system identifier (SID) for the instance is set to ’+ASM’. What is the purpose of this instance?()
第14题:
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?()
第15题:
To take advantage of the capabilities of modern browsers that use web standards, such as XHTML andCSS, your web application is being converted from simple JSP pages to JSP Document format. However,one of your JSPs, /scripts/screenFunctions.jsp, generates a JavaScript file. This file is included in severalweb forms to create screen-specific validation functions and are included in these pages with the followingstatement: 10. 11.
第16题:
You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the
第17题:
You have a new IT manager that has mandated that all JSPs must be refactored to include no scritpletcode. The IT manager has asked you to enforce this. Which deployment descriptor element will satisfy thisconstraint?()
第18题:
&
ACCEPT
PROMPT
&&
第19题:
<c:import url=foo.jsp/>
<c:import page=foo.jsp/>
<c:include url=foo.jsp/>
<c:include page=foo.jsp/>
第20题:
Add attributes to the session object.
Add attributes on the request object.
Add parameters to the request object.
Use the pageContext object to add request attributes.
Add parameters to the JSP’s URL when generating the request dispatcher.
第21题:
<%@ import file=’/common/menu.html’ %>
<%@ page import=’/common/menu.html’ %>
<%@ import page=’/common/menu.html’ %>
<%@ include file=’/common/menu.html’ %>
<%@ page include=’/common/menu.html’ %>
第22题:
<%! import java.util.*; %>
<%! import java.util.List;import java.util.ArrayList; %>
<%@ page import=’java.util.List’import=’java.util.ArrayList’ %>
<%@ import types=’java.util.List’types=’java.util.ArrayList’ %>
<%@ page import=’java.util.List,java.util.ArrayList’ %>
<%@ import types=’java.util.List,java.util.ArrayList’ %>
第23题:
<%@ page isThreadSafe=’false’ %>
<%@ implements SingleThreadModel %>
<%! implements SingleThreadModel %>
<%@ page useSingleThreadModel=’true’ %>
<%@ page implements=’SingleThreadModel’ %>
第24题:
This instance is being used to manage the operating system files.
This instance is being used to manage the files of other databases.
This instance is being used to manage the instances of other databases.
This instance is being used to manage the background processes of other instances.