<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>
第1题:
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?()
第2题:
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?()
第3题:
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?()
第4题:
第5题:
All of your JSPs need to have a link that permits users to email the web master. This web application islicensed to many small businesses, each of which have a different email address for the web master. Youhave decided to use a context parameter that you specify in the deployment descriptor, like this: 42.
第6题:
You want to create a valid directory structure for your Java EE web application, and you want to put yourweb application into a WAR file called MyApp.war. Which two are true about the WAR file?()
第7题:
<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>
<jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>
<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>
<jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>
第8题:
FTP
XCOPY
the Publish Web tool
the Copy Web tool
第9题:
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.
第10题:
<jsp:insert page=’${bodyURL}’ />
<jsp:insert file=’${bodyURL}’ />
<jsp:include page=’${bodyURL}’ />
<jsp:include file=’${bodyURL}’ />
<jsp:insert page=’<%= bodyURL %>’ />
第11题:
<%@ 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’ %>
第12题:
<a href=’mailto:${contextParam.webmasterEmail}’>contact us</a>
<a href=’mailto:${applicationScope.webmasterEmail}’>contact us</a>
<a href=’mailto:${contextInitParam.webmasterEmail}’>contact us</a>
<a href=’mailto:${initParam.webmasterEmail}’>contact us</a>
第13题:
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?()
第14题:
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.
第15题:
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
第16题:
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?()
第17题:
You want to create a valid directory structure for your Java EE web application, and your application usestag files and a JAR file. Which three must be located directly in your WEB-INF directory(NOT in asubdirectory of WEB-INF)?()
第18题:
Every morning, you inspect your company's development and staging servers. You do this to ensure that the servers have the same versions of all files in your Web application.For security reasons, you can only access the staging server through FTP.You need to synchronize files from the staging server so that the staging server matches the development server.You want to achieve this goal by using the minimum amount of administrative effort. Which tool should you use?()
第19题:
Tag files can only be accessed using a tagdir attribute.
The sort.jsp page translates successfully and invokes the tag defined by beta.tag.
The sort.jsp page produces a translation error because a taglib directive must always have a uriattribute.
Tag files can only be placed in /WEB-INF/tags, and NOT in any subdirectories of /WEB- INF/tags.
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.
第20题:
The JAR file
A directory called lib
A directory called tags
A directory called TLDs
A directory called classes
A directory called META-INF
第21题:
<% if ( request.isUserInRole(SalesManager) ) { %> <%@ include file=’/WEB-INF/html/sales-mgr-menu.html’ %> <% } %>
<jsp:if test=’request.isUserInRole(SalesManager)’> <%@ include file=’/WEB-INF/html/sales-mgr-menu.html’ %> </jsp:if>
<% if ( request.isUserInRole(SalesManager) ) { %> . <jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ /> . <% } %>
<jsp:if test=’request.isUserInRole(SalesManager)’> <jsp:include file=’/WEB-INF/html/sales-mgr-menu.html’ /> </jsp:if>
第22题:
<%@ 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.
第23题:
<%@ page isThreadSafe=’false’ %>
<%@ implements SingleThreadModel %>
<%! implements SingleThreadModel %>
<%@ page useSingleThreadModel=’true’ %>
<%@ page implements=’SingleThreadModel’ %>