Q&A

Q1:What are the five constituent libraries of the JSTL.
A1: JSTL includes a core library, which provides general purpose programming constructs; an SQL library with support for relational database access; an XML library with support for the XPath expression language, with support for managing XML documents; an Internationalization and formatting library, which simplifies writing JSPs for different client locales and a Function library for manipulating strings.
Q2:What is the name of the Java package that supports the development of custom tags, and what are the two classes that are normally extended by custom tags?
A2: The custom tag package is javax.servlet.jsp.tagext, and the two super classes used for most tags are TagSupport and BodyTagSupport.
Q3:What are the five methods you can override when extending BodyTagSupport, including parameters and return type? In what order are these methods called when processing the custom tag?
A3: The BodyTagSupport methods in execution order are
  1. int doStartTag()

  2. void doInitBody()

  3. int doAfterBody()

  4. int doEndTag()

  5. void release()

Q4:What does TLD stand for and what is it used for?
A4: TLD is the Tag Library Descriptor and is used to define the library name and version of the JSP specification to which your tags conform. It also lists every tag in your library.
Q5:What are the five XML elements that are used in the custom tag <tag> entry in the TLD?
A5: The most common tags used in the <tag> entry in a TLD are
  1. <name> The tag name

  2. <tag-class> The implementing Java class

  3. <body-content> How the tag body is defined

  4. <attribute> Defines an attribute for the tag

  5. <variable> Defines a scripting variable created by the tag

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.163.175