Reputation: 5118
We usually give reference to external taglib as <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
Can we define our custom taglib and uri
in our jsp as below?
<%@ taglib uri="com.mycompany.taglib" prefix="custom"%>
Upvotes: 1
Views: 1540
Reputation: 456
Yes, one cane define custom tags. Take a look at this Java EE tutorial.
Upvotes: 0
Reputation: 303
Yes, you need to to have tablib.tld file with your tags definitions and the taglib section with in web.xml
Upvotes: 0
Reputation: 59686
Can we define our custom taglib?
What you have to do is create a tag handler class and tld file then import that tld file in your jsp page as
<%@taglib prefix="myCustomTag" tagdir="/WEB-INF/myCustomerTag.tld"%>
Useful links:
Upvotes: 3