Multiple choice technology programming languages

A JSP file that uses a tag library must declare the tag library first. The tag library is defined using the taglib directive - <%= taglib uri="..." prefix="..."%> Which of the following specifies the correct purpose of prefix attribute. Select the one correct answer.

  1. A. The prefix defines the name of the tag that may be used for a tag library

  2. B. The prefix attribute defines the location of the tag library descriptor file.

  3. C. The prefix attribute should refer to the short name attribute of the tag library file that is defined by the uri attribute of taglib directive.

  4. D. The prefix attribute is used in front of a tagname of a tag defined within the tag library.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In JSP tag libraries, the prefix attribute serves as a namespace identifier. When you declare a tag library with <%@ taglib uri="..." prefix="..." %>, the prefix defines the short name you'll use to reference tags from that library in the JSP page. You then use this prefix before tag names, like . The prefix itself doesn't define the tag name or point to the TLD location - it's simply used as a namespace qualifier before tag names to distinguish them from tags in other libraries or standard JSP elements.