niusouti.com

A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed.  Which two are true? ()A、 A  element in the echo tag LTD must have the value JSPB、 The echo tag handler must define the set

题目

A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed.  Which two are true? ()

  • A、 A  element in the echo tag LTD must have the value JSP
  • B、 The echo tag handler must define the setAttribute (String key, String value) method
  • C、 The true element must appear in the echo tag TLD
  • D、 The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.IterationTag interface
  • E、 The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.DynamicAttributes interface

相似考题
更多“A custom JSP ”相关问题
  • 第1题:

    YouhaveanewITmanagerthathasmandatedthatallJSPsmustberefactoredtoincludenoscritpletcode.TheITmanagerhasaskedyoutoenforcethis.Whichdeploymentdescriptorelementwillsatisfythisconstraint?()

    A.<jsp-property-group>.<url-pattern>*.jsp</url-pattern>.<permit-scripting>false</permit-scripting>.</jsp-property-group>

    B.<jsp-config>.<url-pattern>*.jsp</url-pattern><permit-scripting>false</permit-scripting>.</jsp-config>

    C.<jsp-config>.<url-pattern>*.jsp</url-pattern>.<scripting-invalid>true</scripting-invalid>.</jsp-config>

    D.<jsp-property-group>.<url-pattern>*.jsp</url-pattern>.<scripting-invalid>true</scripting-invalid>.</jsp-property-group>


    参考答案:D

  • 第2题:

    WhichJSPstandardactioncanbeusedtoimportcontentfromaresourcecalledfoo.jsp?()

    A.<jsp:importfile=’foo.jsp’/>

    B.<jsp:importpage=’foo.jsp’/>

    C.<jsp:includepage=’foo.jsp’/>

    D.<jsp:includefile=’foo.jsp’/>


    参考答案:C

  • 第3题:

    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

  • 第4题:

    Which JSP standard action can be used to import content from a resource called foo.jsp?()

    • A、<jsp:import file=’foo.jsp’ />
    • B、<jsp:import page=’foo.jsp’ />
    • C、<jsp:include page=’foo.jsp’ />
    • D、<jsp:include file=’foo.jsp’ />

    正确答案:C

  • 第5题:

    JSP标准动作不包括()。 

    • A、<jsp:forward /> 
    • B、<jsp:forEach /> 
    • C、<jsp:useBean /> 
    • D、<jsp:setProperry /> 

    正确答案:B

  • 第6题:

    下列哪一项不属于JSP动作指令标记?()

    • A、〈jsp:param〉
    • B、〈jsp:plugin〉
    • C、〈jsp:useBean〉
    • D、〈jsp:javaBean〉

    正确答案:D

  • 第7题:

    JSP页面包括以下哪些元素?()

    • A、JSP指令
    • B、JSP Action
    • C、JSP脚本
    • D、JSP控件

    正确答案:A,B,C

  • 第8题:

    Which two are valid and equivalent?()

    • A、<%! int i; %>
    • B、<%= int i; %>
    • C、<jsp:expr>int i;</jsp:expr>
    • D、<jsp:scriptlet>int i;</jsp:scriptlet>
    • E、<jsp:declaration>int i;</jsp:declaration>

    正确答案:A,E

  • 第9题:

    多选题
    A custom tag is defined to take three attributes. Which two correctly invoke the tag within a JSP page?()
    A

    <prefix:myTag a=foo b=bar c=baz />

    B

    <prefix:myTag attributes={foo,bar,baz} />

    C

    <prefix:myTag jsp:attribute a=foo b=bar c=baz />

    D

    <prefix:myTag><jsp:attribute name=a>foo</jsp:attribute><jsp:attribute name=b>bar</jsp:attribute><jsp:attribute name=c>baz</jsp:attribute>. </prefix:myTag>


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

  • 第10题:

    多选题
    A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed.  Which two are true? ()
    A

    A  element in the echo tag LTD must have the value JSP

    B

    The echo tag handler must define the setAttribute (String key, String value) method

    C

    The true element must appear in the echo tag TLD

    D

    The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.IterationTag interface

    E

    The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.DynamicAttributes interface


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

  • 第11题:

    单选题
    下列对custom tags的论述哪个不正确()
    A

    是开发者自己定义的tag,可以在JSP页面中使用

    B

    JSP中定制标记符,实质上就是以标记的形式封装了一个俱有独立功能的Java类

    C

    必须依靠TLD文件实现custom tag到实现类的映射

    D

    是某些厂商自己实现的JSP扩展


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

  • 第12题:

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


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

  • 第13题:

    Formanageabilitypurposes,youhavebeentoldtoadda"count"instancevariabletoacriticalJSP DocumentsothataJMXMBeancantrackhowfrequentthisJSPisbeinginvoked.WhichJSPcodesnippetmustyouusetodeclarethisinstancevariableintheJSPDocument?()

    A.<jsp:declaration>intcount=0;<jsp:declaration>

    B.<%!intcount=0;%>

    C.<jsp:declaration.instance>intcount=0;.<jsp:declaration.instance>

    D.<jsp:scriptlet.declaration>intcount=0;.<jsp:scriptlet.declaration>


    参考答案:A

  • 第14题:

    有三个页面,a.jsp,b.jsp和c.jsp,流程是:a.jsp->b.jsp->c.jsp,其中a.jsp中提交的数据要在c.jsp中访问,用最简单的方法 怎么做?注意不能放在session里


    正确答案:

     

    用隐藏表单域,即在b.jsp页面中用N个hidden把上一页面提交过来的信息保存下来,然后和当前一起提交,再到c.jsp里面获取
    说明:尽量不要用session和少用session

  • 第15题:

    JavaBean可以通过相关jsp动作指令进行调用。下面哪个不是JavaBean可以使用的jsp动作指令?()

    • A、〈jsp:useBean〉
    • B、〈jsp:setProperty〉
    • C、〈jsp:getProperty〉
    • D、〈jsp:setParameter〉

    正确答案:D

  • 第16题:

    下列对custom tags的论述哪个不正确()

    • A、是开发者自己定义的tag,可以在JSP页面中使用
    • B、JSP中定制标记符,实质上就是以标记的形式封装了一个俱有独立功能的Java类
    • C、必须依靠TLD文件实现custom tag到实现类的映射
    • D、是某些厂商自己实现的JSP扩展

    正确答案:D

  • 第17题:

    用于获取bean属性的动作是()。

    • A、〈jsp:uscBean〉
    • B、〈jsp:getProperty〉
    • C、〈jsp:setProperty〉
    • D、〈jsp:forward〉

    正确答案:B

  • 第18题:

    下面哪个不是JSP中和javabean相关的标记?()

    • A、〈jsp:userBean〉
    • B、〈jsp:include〉
    • C、〈jsp:setProperty〉
    • D、〈jsp:getProperty〉

    正确答案:B

  • 第19题:

    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

  • 第20题:

    单选题
    下面哪个不是JSP中和javabean相关的标记?()
    A

    〈jsp:userBean〉

    B

    〈jsp:include〉

    C

    〈jsp:setProperty〉

    D

    〈jsp:getProperty〉


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

  • 第21题:

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


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

  • 第22题:

    单选题
    Which of the following is NOT one of the three details you need to fill in on the New Custom Control dialog?()
    A

    Name of the custom control

    B

    Comments to describe the custom control

    C

    List of the controls that will make up this custom control

    D

    Application that will contain the custom control


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

  • 第23题:

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


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