🎴 Flashcard Mode

Oracle SQL and Java J2EE Web Development Quiz

Card1 / 20
Mastered0
Review0
QuestionClick to flip

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.

AnswerClick to flip back
A
D. The prefix attribute is used in front of a tagname of a tag defined within the tag library.
💡 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 prefix:tagName. 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.

Change Mode