单选题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 TLDB Scriptlet code is NOT legal in the body of st:simpleC Add scripting-enabled= “true” to the start tag for the st:simple elementD 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.

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


参考解析

解析: 暂无解析

相关考题:

阅读下列函数说明和C代码,将应填入(n) 处的字句写在对应栏内。【说明】函数print(BinTreeNode*t; DateType x)的功能是在二叉树中查找值为x的结点,并打印该结点所有祖先结点。在此算法中,假设值为x的结点不多于一个。此算法采用后序的非递归遍历形式。因为退栈时需要区分右子树。函数中使用栈ST保存结点指针ptr以及标志tag,Top是栈顶指针。【函数】void print( BinTreeNode * t; DateType x) {stack ST; int i, top; top = 0;//置空栈while(t! = NULL t-> data!= x || top!=0){ while(t!= NULL t-> data!=x){/*寻找值为x的结点*/(1);ST[top]. ptr = t;ST[top]. tag = 0;(2);}if(t!= Null t -> data == x) { /*找到值为x的结点*/for(i=1;(3);i ++)printf("%d" ,ST[top]. ptr ->data);else {while((4))top--;if(top>0){ST[top]. tag = 1;(5);}}}

在程序中,以下哪个内容不属于全局变量?()A、“Tag_1”B、“Data”.RecordC、#Globle_VarD、“Data”.ST.Var

What is TCI?()A、Tag Calling InterfaceB、Tag Control IdentifierC、ToS Class InterfaceD、Tag Control Information

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 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 setAttribute (String key, String value) methodC、 The true element must appear in the echo tag TLDD、 The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.IterationTag interfaceE、 The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.DynamicAttributes interface

Given: 6. 7.%="processing" % 8. and a custom tag handler for foo which extends TagSupport. Which two are true about thetag handler referenced by foo?()A、The doStartTag method is called once.B、The doAfterBody method is NOT called.C、The EVAL_PAGE constant is a valid return value for the doEndTag method.D、The SKIP_PAGE constant is a valid return value for the doStartTag method.E、The EVAL_BODY_BUFFERED constant is a valid return value for the doStartTag method.

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”);

当Stop、Main和Abort Handler运行结束后Check Handler的条件满足或发出Reset命令,SCM将运行()。A、Stop HandlerB、Check HandlerC、Abort HandlerD、Hold Handler

Which statement is true if the do Start Tag method returns EVAL_BODY_BUFFERED?()A、 The tag handler must extend body Tag.B、 The do After Body method is NOT called.C、 The set Body Content method is called.D、 It is never legal to return EVAL_BODY_BUFFERED from do Start Tag.

Which statement is true if the doStartTag method returns EVAL_BODY_BUFFERED?()A、The tag handler must implement BodyTag.B、The doAfterBody method is NOT called.C、The setBodyContent method is called once.D、It is never legal to return EVAL_BODY_BUFFERED from doStartTag.

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 TLDB、 Scriptlet code is NOT legal in the body of st:simpleC、 Add scripting-enabled= “true” to the start tag for the st:simple elementD、 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.

Given the JSP code: % request.setAttribute("foo", "bar"); %and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()A、String x = (String) pageContext.getAttribute("foo")B、String x = (String) pageContext.getRequestScope("foo")C、It is NOT possible to access the pageContext object from within doStartTagD、String x = (String) pageContext.getRequest().getAttribute("foo")E、String x = (String) pageContext.getAttribute("foo", PageContext.ANY_SCOPE)

You are creating a Windows Forms application by using the .NET Framework 3.5. You plan to develop a new control for the application.You need to ensure that the control extends the TreeView control by adding a custom node tag and a highlight color.What should you do?()A、Override the OnPaint method.B、Write a code segment in the DrawNode event handler to specify the highlight color.C、Set the DrawMode property of the control to OwnerDrawAll, and then implement a custom DrawNode event handler.D、Set the DrawMode property of the control to OwnerDrawText,and then implement a custom DrawNode event handler.

单选题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?()ASet the body content type to JSP in the TLDBScriptlet code is NOT legal in the body of st:simple.CAdd scripting-enabled=true to the start tag for the st:simple elementDAdd 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

单选题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?()AItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() and castingthe result to ShoppingListTag.BShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren() andcasting each to an ItemSimpleTag.CIt 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.DShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() on thePageContext and casting each to an ItemSimpleTag.EItemSimpleTag can find the enclosing instance of ShoppingListTag by calling findAncestorWithClass()on the PageContext and casting the result to ShoppingListTag.

单选题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”);

多选题Which two are true about the tag handler referneed by my Tag. ()AThe do Start Tag method is called once.BThe do After Body method is NOT called.CThe EVAL_Page constant is a valid return value for the do End Tag Method.Dthe EVAL_BODY_BUFFERED constant is a valid return value for the do Start Tag method.

单选题Which statement is true if the doStartTag method returns EVAL_BODY_BUFFERED?()AThe tag handler must implement BodyTag.BThe doAfterBody method is NOT called.CThe setBodyContent method is called once.DIt is never legal to return EVAL_BODY_BUFFERED from doStartTag.

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

单选题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?()Apublic void doTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}Bpublic void doStartTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}Cpublic void doTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }Dpublic void doStartTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }

多选题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? ()AA  element in the echo tag LTD must have the value JSPBThe echo tag handler must define the setAttribute (String key, String value) methodCThe true element must appear in the echo tag TLDDThe class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.IterationTag interfaceEThe class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.DynamicAttributes interface

单选题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 TLDB Scriptlet code is NOT legal in the body of st:simpleC Add scripting-enabled= “true” to the start tag for the st:simple elementD 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.

单选题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?()AStore the data in a public instance variable in the servlet.BAdd an attribute to the request object before using the request dispatcher.CAdd an attribute to the context object before using the request dispatcher.DThis CANNOT be done as the tag handler has no means to extract this data.

单选题Which statement is true if the do Start Tag method returns EVAL_BODY_BUFFERED?()A The tag handler must extend body Tag.B The do After Body method is NOT called.C The set Body Content method is called.D It is never legal to return EVAL_BODY_BUFFERED from do Start Tag.

单选题Assuming that the serializeBanana2() and the deserializeBanana2() methods will correctly use Java serialization and given:  import java.io.*;  class Food {Food() { System.out.print(”1”); } }  class Fruit extends Food implements Serializable {  Fruit() { System.out.print(”2”); } }  public class Banana2 extends Fruit { int size = 42;  public static void main(String [] args) {  Banana2 b = new Banana2();  b.serializeBanana2(b); // assume correct serialization  b = b.deserializeBanana2(b); // assume correct  System.out.println(” restored “+ b.size + “ “); }  // more Banana2 methods  }  What is the result?()A Compilation fails.B 1 restored 42C 12 restored 42D 121 restored 42E 1212 restored 42F An exception is thrown at runtime.

单选题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?()AItemSimpleTag can find the enclosing instance of ShoppingListTag by calling getParent() and castingthe result to ShoppingListTag.BShoppingListTag can find the child instances of ItemSimpleTag by calling super.getChildren() andcasting each to an ItemSimpleTag.CIt 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.DShoppingListTag can find the child instances of ItemSimpleTag by calling getChildren() on thePageContext and casting each to an ItemSimpleTag.EItemSimpleTag can find the enclosing instance of ShoppingListTag by calling findAncestorWithClass()on the PageContext and casting the result to ShoppingListTag.

多选题Given: 6. 7. 8. and a custom tag handler for foo which extends TagSupport. Which two are true about thetag handler referenced by foo?()AThe doStartTag method is called once.BThe doAfterBody method is NOT called.CThe EVAL_PAGE constant is a valid return value for the doEndTag method.DThe SKIP_PAGE constant is a valid return value for the doStartTag method.EThe EVAL_BODY_BUFFERED constant is a valid return value for the doStartTag method.

单选题Given the JSP code: and the Classic tag handler code: 5. public int doStartTag() throws JspException { 6. // insert code here 7. // return int 8. } Assume there are no other "foo" attributes in the web application. Which invocation on the pageContextobject,inserted at line 6,assigns "bar" to the variable x?()AString x = (String) pageContext.getAttribute(foo)BString x = (String) pageContext.getRequestScope(foo)CIt is NOT possible to access the pageContext object from within doStartTagDString x = (String) pageContext.getRequest().getAttribute(foo)EString x = (String) pageContext.getAttribute(foo, PageContext.ANY_SCOPE)