单选题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?()Ajsp:declarationint count = 0;jsp:declarationB%! int count = 0; %Cjsp:declaration.instanceint count = 0;. jsp:declaration.instanceDjsp:scriptlet.declarationint count = 0;. jsp:scriptlet.declaration

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


参考解析

解析: 暂无解析

相关考题:

You are creating a class that performs complex financial calculations.The class contains a method named GetCurrentRate that retrieves the current interest rate and a variable named currRate that stores the current interest rate.You write serialized representations of the class.You need to write a code segment that updates the currRate variable with the current interest ratewhen an instance of the class is deserialized.Which code segment should you use?()A.B.C.D.

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:declarationint count = 0;jsp:declarationB、%! int count = 0; %C、jsp:declaration.instanceint count = 0;. jsp:declaration.instanceD、jsp:scriptlet.declarationint count = 0;. jsp:scriptlet.declaration

Every page of your web site must include a common set of navigation menus at the top of the page. Thismenu is static HTML and changes frequently,so you have decided to use JSP’s static import mechanism. Which JSP code snippet accomplishes this goal?()A、%@ import file=’/common/menu.html’ %B、%@ page import=’/common/menu.html’ %C、%@ import page=’/common/menu.html’ %D、%@ include file=’/common/menu.html’ %E、%@ page include=’/common/menu.html’ %

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 by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()A、Store the data in a public instance variable in the servlet.B、Add an attribute to the request object before using the request dispatcher.C、Add an attribute to the context object before using the request dispatcher.D、This CANNOT be done as the tag handler has no means to extract this data.

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?()A、%! int count = 0; %% if ( request.getSession(false) == null ) count++; %B、%@ int count = 0; %. % if ( request.getSession(false) == null ) count++; %C、% int count = 0;. if ( request.getSession(false) == null ) count++; %D、%@ int count = 0;. if ( request.getSession(false) == null ) count++; %E、%! int count = 0;. if ( request.getSession(false) == null ) count++; %

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?()A、 This instance is being used to manage the operating system files.B、 This instance is being used to manage the files of other databases.C、 This instance is being used to manage the instances of other databases.D、 This instance is being used to manage the background processes of other instances.

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’ %

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.

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’ %

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.  14. 15. Which JSP code snippet declares that this JSP Document is a JavaScript file?()A、%@ page contentType=’application/javascript’ %B、jsp:page contentType='application/javascript' /C、jsp:document contentType='application/javascript' /D、jsp:directive.page contentType='application/javascript' /E、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. tag.

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 %’ /

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  tag that requires the page name tobe specified dynamically when the header is imported. Which JSP code snippet performs the import of theheader content?() titleA、jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:includeB、jsp:import page=’/WEB-INF/jsp/header.jsp’jsp:param name=’pageName’ value=’Welcome Page’ / /jsp:importC、jsp:include page=’/WEB-INF/jsp/header.jsp’jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:includeD、jsp:import page=’/WEB-INF/jsp/header.jsp’. jsp:attribute name=’pageName’ value=’Welcome Page’ / . /jsp:import

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?()A、Add attributes to the session object.B、Add attributes on the request object.C、Add parameters to the request object.D、Use the pageContext object to add request attributes.E、Add parameters to the JSP’s URL when generating the request dispatcher.

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?()A、jsp-property-group. url-pattern*.jsp/url-pattern. permit-scriptingfalse/permit-scripting. /jsp-property-groupB、jsp-config. url-pattern*.jsp/url-patternpermit-scriptingfalse/permit-scripting. /jsp-configC、jsp-config. url-pattern*.jsp/url-pattern. scripting-invalidtrue/scripting-invalid. /jsp-configD、jsp-property-group. url-pattern*.jsp/url-pattern. scripting-invalidtrue/scripting-invalid. /jsp-property-group

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?()A、You should install SQL Server 2008 as a named instance, and make the new application to use the new instance. B、You should install SQL Server 2008 as the default instance, and make the new application to use the default instance. C、You should upgrade the SQL Server 2005 application to use SQL Server 2008. D、You should upgrade the SQL Server 2005 instance to a SQL Server 2008 instance.

单选题Which substitution variable would you use if you want to reuse the variable without prompting the user each time? ()ABACCEPTCPROMPTD

单选题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 by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()AStore the data in a public instance variable in the servlet.BAdd an attribute to the request object before using the request dispatcher.CAdd an attribute to the context object before using the request dispatcher.DThis CANNOT be done as the tag handler has no means to extract this data.

单选题Which JSTL code snippet can be used to import content from another web resource?()Ac:import url=foo.jsp/Bc:import page=foo.jsp/Cc:include url=foo.jsp/Dc:include page=foo.jsp/

多选题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?()AIn the init method.BIn the jspInit method.CIn the constructor of the JSP’s Java code.DIn a JSP declaration, which includes an initializer block.EIn a JSP declaration, which includes a static initializer block.

多选题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?()AAdd attributes to the session object.BAdd attributes on the request object.CAdd parameters to the request object.DUse the pageContext object to add request attributes.EAdd parameters to the JSP’s URL when generating the request dispatcher.

单选题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.  14. 15. Which JSP code snippet declares that this JSP Document is a JavaScript file?()A%@ page contentType=’application/javascript’ %Bjsp:page contentType='application/javascript' /Cjsp:document contentType='application/javascript' /Djsp:directive.page contentType='application/javascript' /ENo declaration is needed because the web form XHTML page already declares the MIME type of the /scripts/screenFunctions.jsp file in the script tag. tag.

单选题Every page of your web site must include a common set of navigation menus at the top of the page. Thismenu is static HTML and changes frequently,so you have decided to use JSP’s static import mechanism. Which JSP code snippet accomplishes this goal?()A%@ import file=’/common/menu.html’ %B%@ page import=’/common/menu.html’ %C%@ import page=’/common/menu.html’ %D%@ include file=’/common/menu.html’ %E%@ page include=’/common/menu.html’ %

单选题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?()A%! int count = 0; %% if ( request.getSession(false) == null ) count++; %B%@ int count = 0; %. % if ( request.getSession(false) == null ) count++; %C% int count = 0;. if ( request.getSession(false) == null ) count++; %D%@ int count = 0;. if ( request.getSession(false) == null ) count++; %E%! int count = 0;. if ( request.getSession(false) == null ) count++; %

多选题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’ %

单选题Your web application views all have the same header, which includes the  tag in the  elementof the rendered HTML. You have decided to remove this redundant HTML code from your JSPs and put itinto a single JSP called /WEB-INF/jsp/header.jsp. However, the title of each page is unique, so you havedecided to use a variable called pageTitle to parameterize this in the header JSP, like this: 10.${param.pageTitle} Which JSP code snippet should you use in your main view JSPs to insert the header and pass thepageTitle variable?()Ajsp:insert page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:insertBjsp:include page=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeCjsp:include file=’/WEB-INF/jsp/header.jsp’. ${pageTitle=’Welcome Page’}. /jsp:includeDjsp:insert page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:insertEjsp:include page=’/WEB-INF/jsp/header.jsp’. jsp:param name=’pageTitle’ value=’Welcome Page’ / . /jsp:include

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

单选题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?()A This instance is being used to manage the operating system files.B This instance is being used to manage the files of other databases.C This instance is being used to manage the instances of other databases.D This instance is being used to manage the background processes of other instances.