Reputation: 7357
I always add the following line as I write a jsp
-page:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
But what does <%@ %>
mean in general? I know that we can embed code to the jsp by a scriptlet
<% \\some java code %>
So @taglib
looks like an annotation being applied to the prefix
. Is it correct?
Upvotes: 3
Views: 234
Reputation: 199
It is a JSP Directive.The JSP directives are messages that tells the web container how to translate a JSP page into the corresponding servlet.The taglib directive is one of the JSP directive.The JSP taglib directive is used to define a tag library that defines many tags.
Upvotes: 0
Reputation: 32145
The <%@ >
is a tag for JSP - Directives, that can be :
Page directive <%@ page ... %> : Defines page-dependent attributes, such as scripting language, error page, and buffering requirements.
Include directive <%@ include ... %> : Includes a file during the translation phase.
Taglib directive <%@ taglib ... %> : Declares a tag library, containing custom actions, used in the page.
Upvotes: 1
Reputation: 28539
Its a JSP directive
JSP directives provide directions and instructions to the container, telling it how to handle certain aspects of JSP processing. A JSP directive affects the overall structure of the servlet class. It usually has the following form:
<%@ directive attribute="value" %>
Upvotes: 4