SCWCD(310-083)

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

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

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

第1题:

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

第2题:

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.

正确答案:D

第3题:

Youarebuildingyourownlayoutmechanismbyincludingdynamiccontentforthepage’sheaderandfootersections.Thefooterisalwaysstatic,buttheheadergeneratesthe<title>tagthatrequiresthepagenametobespecifieddynamicallywhentheheaderisimported.WhichJSPcodesnippetperformstheimportoftheheadercontent?()

A.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:include>

B.<jsp:importpage=’/WEB-INF/jsp/header.jsp’><jsp:paramname=’pageName’value=’WelcomePage’/></jsp:import>

C.<jsp:includepage=’/WEB-INF/jsp/header.jsp’><jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:include>

D.<jsp:importpage=’/WEB-INF/jsp/header.jsp’>.<jsp:attributename=’pageName’value=’WelcomePage’/>.</jsp:import>


参考答案:A

第4题:

You are building JSP pages that have a set of menus that are visible based on a user’s security role. Thesemenus are hand-crafted by your web design team; for example, the SalesManager role has a menu in thefile /WEB-INF/html/sales-mgr-menu.html. Which JSP code snippet should be used to make this menuvisible to the user?()

  • A、<% if ( request.isUserInRole("SalesManager") ) { %> <%@ include file=’/WEB-INF/html/sales-mgr-menu.html’ %> <% } %>
  • B、<jsp:if test=’request.isUserInRole("SalesManager")’> <%@ include file=’/WEB-INF/html/sales-mgr-menu.html’ %> </jsp:if>
  • C、<% if ( request.isUserInRole("SalesManager") ) { %> . <jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ /> . <% } %>
  • D、<jsp:if test=’request.isUserInRole("SalesManager")’> <jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ /> </jsp:if>

正确答案:A

第5题:

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?() <title>

  • A、<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>
  • B、<jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>
  • C、<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>
  • D、<jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>

正确答案:A

第6题:

Squeaky Beans Inc. hired an outside consultant to develop their web application. To finish the job quickly, the consultant created several dozen JSP pages that directly communicate with the database. The Squeaky business team has since purchased a set of business objects to model their system, and the Squeaky developer charged with maintaining the web application must now refactor all the JSPs to work with the new system.  Which pattern can the developer use to solve this problem?()

  • A、 Transfer Object
  • B、 Service Locator
  • C、 Intercepting Filter
  • D、 Business Delegate

正确答案:D

第7题:

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

第8题:

Totakeadvantageofthecapabilitiesofmodernbrowsersthatusewebstandards,suchasXHTMLandCSS,yourwebapplicationisbeingconvertedfromsimpleJSPpagestoJSPDocumentformat.However,oneofyourJSPs,/scripts/screenFunctions.jsp,generatesaJavaScriptfile.Thisfileisincludedinseveralwebformstocreatescreen-specificvalidationfunctionsandareincludedinthesepageswiththefollowingstatement:

10.<head>

11.<scriptsrc=‘/scripts/screenFunctions.jsp‘

12.language=‘javascript‘

13.type=‘application/javascript‘></script>

14.</head>

15.<!--bodyofthewebform-->

WhichJSPcodesnippetdeclaresthatthisJSPDocumentisaJavaScriptfile?()


参考答案:D

第9题:

A web application contains a tag file called beta.tag in /WEB-INF/tags/alpha. A JSP page called sort.jspexists in the web application and contains only this JSP code: 1.<%@ taglib prefix="x" 2.tagdir="/WEB-INF/tags/alpha" %> 3. The sort.jsp page is requested. Which two are true?()

  • A、Tag files can only be accessed using a tagdir attribute.
  • B、The sort.jsp page translates successfully and invokes the tag defined by beta.tag.
  • C、The sort.jsp page produces a translation error because a taglib directive must always have a uriattribute.
  • D、Tag files can only be placed in /WEB-INF/tags, and NOT in any subdirectories of /WEB- INF/tags.
  • E、The tagdir attribute in line 2 can be replaced by a uri attribute if a TLD referring to beta.tag is createdand added to the web application.

正确答案:B,E

第10题:

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.

正确答案:B,E

更多相关问题