I have this class inside tag pachage that it's used to tld file
package tag;
import java.io.IOException;
import java.time.LocalDate;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
public class printDateTag extends TagSupport{
@Override
public int doStartTag() throws JspException {
try {
JspWriter writer = pageContext.getOut();
writer.print(LocalDate.now());
} catch (IOException ex) {System.out.println(ex);}
return SKIP_BODY;
}
}
My tld file that uses that class is this
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.1" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
<tlib-version>1.0</tlib-version>
<short-name>tags</short-name>
<uri>/WEB-INF/tlds/tags</uri>
<tag>
<name>printDate</name>
<tag-class>tag.printDateTag</tag-class>
</tag>
And the jsp where i have the error is this
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="ta" uri="/WEB-INF/tlds/tags.tld"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<ta:printDate/>
<a href="index">go</a>
</body>
</html>
Here in <ta:printDate/>
i have the error unable to load tag handler class "tag.printDateTag" for tag "ta:printDate