单选题The sl:shoppingList and sl:item tags output a shopping list to the response and are used as follows: 11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is ItemSimpleTag.ShoppingListTag extends Bod

题目
单选题
The sl:shoppingList and sl:item tags output a shopping list to the response and are used as follows: 11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is ItemSimpleTag.ShoppingListTag extends BodyTagSupport and ItemSimpleTag extends SimpleTagSupport.Which is true?()
A

ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() and castingthe result to ShoppingListTag.

B

ShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren() andcasting each to an ItemSimpleTag.

C

It is impossible for ItemSimpleTag and ShoppingListTag to find each other in a tag hierarchy becauseone is a Simple tag and the other is a Classic tag.

D

ShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() on thePageContext and casting each to an ItemSimpleTag.

E

ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling findAncestorWithClass()on the PageContext and casting the result to ShoppingListTag.


相似考题
更多“单选题The sl:shoppingList and sl:item tags output a shopping list to the response and are used as follows: 11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is ItemSimpleTag.ShoppingListTag extends Bod”相关问题
  • 第1题:

    下列程序段执行后,内存变量sl的值是( )。 s1="network" sl=stuff(sl,4,4,"BIOS") ? s1

    A.network

    B.netBl0S

    C.net

    D.BIOS


    正确答案:B
    B。【解析】子串替换函数STUFF(<字符表达式1>,<起始位置>,<长度>,<字符串表达式2>)的含义如下:用<字符串表达式2>值替换<字符表达式1>中由<起始位置>和<长度>指明的一个子串。

  • 第2题:

    机油品质的字母SL/SL和CF/CG分别表示什么?


    正确答案: 1、SL/SL表示汽油引擎车使用;
    2、CF/CG表示柴油引擎车使用。

  • 第3题:

    You are creating a content management system (CMS) with a web application front-end. The JSP thatdisplays a given document in the CMS has the following general structure: 1. <%-- tag declaration --%> 2.  ... 11. ...  ... ... 99.  The citation tag must store information in the document tag for the document tag to generate a referencesection at the end of the generated web page. The document tag handler follows the Classic tag model andthe citation tag handler follows the Simple tag model. Furthermore, the citation tag could also be embeddedin other custom tags that could have either the Classic or Simple tag handler model. Which tag handlermethod allows the citation tag to access the document tag?()

    • A、public void doTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}
    • B、public void doStartTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}
    • C、public void doTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }
    • D、public void doStartTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }

    正确答案:A

  • 第4题:

    Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()

    • A、 pageContext.getAttribute(“foo”);
    • B、 getPageContext().getAttribute(“foo”);
    • C、 pageContext.getApplicationScope(“foo”);
    • D、 pageContext.getAttribute(“foo”,pageContext.APPLICATION_SCOPE).getAttribute(“foo”);
    • E、 getPageContext().getScope(pageContext.APPLICATION_SCOPE).getAttribute(“foo”);

    正确答案:D

  • 第5题:

    下列哪个不是SSL现有的版本()

    • A、SL1.0
    • B、SL2.0
    • C、SL3.0
    • D、SL4.0

    正确答案:D

  • 第6题:

    Assume the tag handler for a st:simpletag extends SimpleTagSupport. In what way can scriptlet code be used in the body of st:simple?()

    • A、 Set the body content type to JSP in the TLD
    • B、 Scriptlet code is NOT legal in the body of st:simple
    • C、 Add scripting-enabled= “true” to the start tag for the st:simple element
    • D、 Add a pass-through Classic tag with a body content type of JSP to the body of st:simple, and      place the scriptlet code in the body of that tag.

    正确答案:B

  • 第7题:

    The sl:shoppingList and sl:item tags output a shopping list to the response and are used as follows: 11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is ItemSimpleTag.ShoppingListTag extends BodyTagSupport and ItemSimpleTag extends SimpleTagSupport.Which is true?()

    • A、ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() and castingthe result to ShoppingListTag.
    • B、ShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren() andcasting each to an ItemSimpleTag.
    • C、It is impossible for ItemSimpleTag and ShoppingListTag to find each other in a tag hierarchy becauseone is a Simple tag and the other is a Classic tag.
    • D、ShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() on thePageContext and casting each to an ItemSimpleTag.
    • E、ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling findAncestorWithClass()on the PageContext and casting the result to ShoppingListTag.

    正确答案:A

  • 第8题:

    单选题
    顺风顺流情况下航行,船舶对水航程SL,对地航程SG,船速VE,航时t,则()。
    A

    SG<SL<VEt

    B

    SL>VEt,且SL>SG

    C

    SG>SL>VEt

    D

    SL<VEt,且SG>SL


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

  • 第9题:

    单选题
    Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()
    A

     pageContext.getAttribute(“foo”);

    B

     getPageContext().getAttribute(“foo”);

    C

     pageContext.getApplicationScope(“foo”);

    D

     pageContext.getAttribute(“foo”,pageContext.APPLICATION_SCOPE).getAttribute(“foo”);

    E

     getPageContext().getScope(pageContext.APPLICATION_SCOPE).getAttribute(“foo”);


    正确答案: 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题:

    单选题
    You are creating a content management system (CMS) with a web application front-end. The JSP thatdisplays a given document in the CMS has the following general structure: 1.  2.  ... 11. ...  ... ... 99.  The citation tag must store information in the document tag for the document tag to generate a referencesection at the end of the generated web page. The document tag handler follows the Classic tag model andthe citation tag handler follows the Simple tag model. Furthermore, the citation tag could also be embeddedin other custom tags that could have either the Classic or Simple tag handler model. Which tag handlermethod allows the citation tag to access the document tag?()
    A

    public void doTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}

    B

    public void doStartTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}

    C

    public void doTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }

    D

    public void doStartTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }


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

  • 第12题:

    单选题
    The sl:shoppingList and sl:item tags output a shopping list to the response and are used as follows: 11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is ItemSimpleTag.ShoppingListTag extends BodyTagSupport and ItemSimpleTag extends SimpleTagSupport.Which is true?()
    A

    ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() and castingthe result to ShoppingListTag.

    B

    ShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren() andcasting each to an ItemSimpleTag.

    C

    It is impossible for ItemSimpleTag and ShoppingListTag to find each other in a tag hierarchy becauseone is a Simple tag and the other is a Classic tag.

    D

    ShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() on thePageContext and casting each to an ItemSimpleTag.

    E

    ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling findAncestorWithClass()on the PageContext and casting the result to ShoppingListTag.


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

  • 第13题:

    目前我国水利水电工程施工质量检验与评定规程采用的标准是( )。

    A.SL380-2007

    B.SL176-2007

    C.SL381-2007

    D.SL385-2007


    正确答案:B

  • 第14题:

    以下单板用在155/622扩展子架上时,需要进行跳线设置的是()。

    • A、SS24SL4
    • B、SS25SL4
    • C、SS26SL4
    • D、SS27SL4

    正确答案:A

  • 第15题:

    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

    正确答案:C,E

  • 第16题:

    Assume the tag handler for a st:simple tag extends Simple Tag Support. In what way can scriptlet code beused in the body of st:simple?()

    • A、Set the body content type to JSP in the TLD
    • B、Scriptlet code is NOT legal in the body of st:simple.
    • C、Add scripting-enabled="true" to the start tag for the st:simple element
    • D、Add a pass-through Classic tag with a body content type of JSP to the body of st:simple, and place the scriptlet code in the body of that tag

    正确答案:B

  • 第17题:

    按姓名字段升序排序,形成名为SL的表文件,下列命令中错误的是()。

    • A、Sort to SL on 姓名
    • B、index to SL on 姓名
    • C、Sort to SL on 姓名/A /C
    • D、Sort to SL on 姓名/A

    正确答案:B

  • 第18题:

    import java.util.*;  public class NameList {  private List names = new ArrayList();  public synchronized void add(String name) { names.add(name); }  public synchronized void printAll() {  for (int i = 0; i System.out.print(names.get(i) +“ “); }  }  public static void main(String[] args) {  final NameList sl = new NameList();  for(int i=0;i<2;i++) {  new Thread() {  public void ruin() {  sl.add(”A”);  sl.add(”B”);  sl.add(”C”);  sl.printAll();  }  }.start();  }  }  }  Which two statements are true if this class is compiled and run?()

    • A、 An exception may be thrown at runtime.
    • B、 The code may run with no output, without exiting.
    • C、The code may rum with output “A B A B C C “, then exit.
    • D、The code may ruin with output “A A A B C A B C C “, then exit.
    • E、 The code may rum with output “A B C A B C A B C “, then exit.
    • F、The code may ruin with output “A B C A A B C A B C “, then exit.

    正确答案:E,F

  • 第19题:

    单选题
    按姓名字段升序排序,形成名为SL的表文件,下列命令中错误的是()。
    A

    Sort to SL on 姓名

    B

    index to SL on 姓名

    C

    Sort to SL on 姓名/A /C

    D

    Sort to SL on 姓名/A


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

  • 第20题:

    单选题
    The sl:shoppingList and sl:item tags output a shopping list to the response and are used as follows: 11. 12. 13. 14. 15. The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for sl:item is ItemSimpleTag.ShoppingListTag extends BodyTagSupport and ItemSimpleTag extends SimpleTagSupport.Which is true?()
    A

    ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() and castingthe result to ShoppingListTag.

    B

    ShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren() andcasting each to an ItemSimpleTag.

    C

    It is impossible for ItemSimpleTag and ShoppingListTag to find each other in a tag hierarchy becauseone is a Simple tag and the other is a Classic tag.

    D

    ShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() on thePageContext and casting each to an ItemSimpleTag.

    E

    ItemSimpleTag can find the enclosing instance of ShoppingListTag by calling findAncestorWithClass()on the PageContext and casting the result to ShoppingListTag.


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

  • 第21题:

    单选题
    Assume the tag handler for a st:simpletag extends SimpleTagSupport. In what way can scriptlet code be used in the body of st:simple?()
    A

     Set the body content type to JSP in the TLD

    B

     Scriptlet code is NOT legal in the body of st:simple

    C

     Add scripting-enabled= “true” to the start tag for the st:simple element

    D

     Add a pass-through Classic tag with a body content type of JSP to the body of st:simple, and      place the scriptlet code in the body of that tag.


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

  • 第22题:

    单选题
    顺风顶流情况下航行,船舶对水航程SL,对地航程SG,船速VE,航时t,则()。
    A

    SG<SL<VEt

    B

    SL>VEt,且SL>SG

    C

    SG>SL>VEt

    D

    SL<VEt,且SG>SL


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

  • 第23题:

    单选题
    The tag handler for n:recurse extends SimpleTagSupport.Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?()
    A

     It is impossible to determine the deepest nesting depth because it is impossible for tag handlers that extend SimpleTagSupport to communicate with their parent and child tags

    B

     Create a private non-static attribute in the tag handler class called count of type int initialized to      oIncrement count in the doTag method. If the tag has a body, invoke the fragment for that body. Otherwise, output the value of count

    C

     Start a counter at 1. Call getChildTags(). If it returns null, output the value of the counter.      Otherwise, increment counter and continue from where getChildTags() is called. Skip      processing of the body.

    D

     If the tag has a body, invoke the fragment for that body. Otherwise, start a counter at 1. Call      getParent(). If it returns null, output the value of the counter. Otherwise, increment the counter      and continue from where getParent() is called.


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

  • 第24题:

    单选题
    Assume the tag handler for a st:simple tag extends Simple Tag Support. In what way can scriptlet code beused in the body of st:simple?()
    A

    Set the body content type to JSP in the TLD

    B

    Scriptlet code is NOT legal in the body of st:simple.

    C

    Add scripting-enabled=true to the start tag for the st:simple element

    D

    Add a pass-through Classic tag with a body content type of JSP to the body of st:simple, and place the scriptlet code in the body of that tag


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