<%@ 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.
第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?()
第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.
第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>
第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?()
第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
第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?()
第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?()
第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?()
第9题:
第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?()