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

题目
单选题
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?()
A

<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:insert>

B

<jsp:include page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>

C

<jsp:include file=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include>

D

<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:insert>

E

<jsp:include page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:include>


相似考题
更多“单选题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, th”相关问题
  • 第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?()

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

    正确答案:D

  • 第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?()

    • A、<%@ page isThreadSafe=’false’ %>
    • B、<%@ implements SingleThreadModel %>
    • C、<%! implements SingleThreadModel %>
    • D、<%@ page useSingleThreadModel=’true’ %>
    • E、<%@ page implements=’SingleThreadModel’ %>

    正确答案:A

  • 第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?()

    • 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

  • 第4题:

    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

  • 第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. 43.webmasterEmail 44.master@example.com 45. Which JSP code snippet creates this email link?()

    • A、<a href=’mailto:${contextParam.webmasterEmail}’>contact us</a>
    • B、<a href=’mailto:${applicationScope.webmasterEmail}’>contact us</a>
    • C、<a href=’mailto:${contextInitParam.webmasterEmail}’>contact us</a>
    • D、<a href=’mailto:${initParam.webmasterEmail}’>contact us</a>

    正确答案:D

  • 第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?()

    • A、At deploy time, Java EE containers add a directory called META-INF directly into the MyApp directory.
    • B、At deploy time, Java EE containers add a file called MANIFEST.MF directly into the MyApp directory.
    • C、It can instruct your Java EE container to verify, at deploy time, whether you have properly configured your application’s classes.
    • D、At deploy time, Java EE containers add a directory call META-WAR directly into the MyApp directory.

    正确答案:A,C

  • 第7题:

    单选题
    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?()
    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
    解析: 暂无解析

  • 第8题:

    单选题
    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?()
    A

    FTP

    B

    XCOPY

    C

    the Publish Web tool

    D

    the Copy Web tool


    正确答案: C
    解析: 暂无解析

  • 第9题:

    多选题
    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.


    正确答案: B,C
    解析: 暂无解析

  • 第10题:

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


    正确答案: B
    解析: 暂无解析

  • 第11题:

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


    正确答案: E
    解析: 暂无解析

  • 第12题:

    单选题
    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. 43.webmasterEmail 44.master@example.com 45. Which JSP code snippet creates this email link?()
    A

    <a href=’mailto:${contextParam.webmasterEmail}’>contact us</a>

    B

    <a href=’mailto:${applicationScope.webmasterEmail}’>contact us</a>

    C

    <a href=’mailto:${contextInitParam.webmasterEmail}’>contact us</a>

    D

    <a href=’mailto:${initParam.webmasterEmail}’>contact us</a>


    正确答案: C
    解析: 暂无解析

  • 第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?()

    • 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.

    正确答案:B,D,E

  • 第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.  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

  • 第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  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

  • 第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?()

    • 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

  • 第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)?()

    • A、The JAR file
    • B、A directory called lib
    • C、A directory called tags
    • D、A directory called TLDs
    • E、A directory called classes
    • F、A directory called META-INF

    正确答案:B,C,E

  • 第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?()

    • A、FTP
    • B、XCOPY
    • C、the Publish Web tool
    • D、the Copy Web tool

    正确答案:D

  • 第19题:

    多选题
    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. 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.


    正确答案: A,B
    解析: 暂无解析

  • 第20题:

    多选题
    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)?()
    A

    The JAR file

    B

    A directory called lib

    C

    A directory called tags

    D

    A directory called TLDs

    E

    A directory called classes

    F

    A directory called META-INF


    正确答案: F,D
    解析: 暂无解析

  • 第21题:

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


    正确答案: C
    解析: 暂无解析

  • 第22题:

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


    正确答案: B
    解析: 暂无解析

  • 第23题:

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


    正确答案: E
    解析: 暂无解析