title: Unable to load tag handler class for custom tag in Java
body: <p>I am working with custom tags in Java and I am getting an error. Let me detail below the files involved:</p>
  
  <p>My tag.tld (path is: \WEB-INF\tlds\tag.tld) has the following content:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" 
                          "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"&gt;
  
  
  &lt;taglib&gt;
  &lt;tlibversion&gt;0.0&lt;/tlibversion&gt;
  &lt;jspversion&gt;1.1&lt;/jspversion&gt;
  &lt;shortname&gt;message&lt;/shortname&gt;
  
  &lt;tag&gt;
  &lt;description&gt;StringReverseTag&lt;/description&gt;
  &lt;name&gt;string&lt;/name&gt;
  &lt;tag-class&gt;mytag.StringReverseTag&lt;/tag-class&gt;
  &lt;body-content&gt;empty&lt;/body-content&gt;
  &lt;attribute&gt;
  &lt;name&gt;data&lt;/name&gt;
  &lt;required&gt;true&lt;/required&gt;
  &lt;/attribute&gt;
  &lt;/tag&gt;
  &lt;/taglib&gt;
  </code></pre>
  
  <p>ReverseEx.jsp</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8" language="java"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;%@taglib uri="/WEB-INF/tlds/tag.tld" prefix="jen" %&gt; 
  &lt;jen:string data="EARTH"/&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Tag Example&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Helper class:</p>
  
  <pre><code>package chap4;
  
  import java.io.IOException;
  import javax.servlet.jsp.tagext.*;
  import javax.servlet.jsp.*;
  
  public class StringReverseTag extends SimpleTagSupport{
      private String data;
      public void setData(String data) {
      this.data=data;
      }
  
      @Override
      public void doTag() throws JspException, IOException{
          JspWriter out = getJspContext().getOut();
          StringBuffer sb= new StringBuffer(data);
          sb.reverse();
          out.print(sb);
      }
  }
  </code></pre>
  
  <p>The error I get is the following:</p>
  
  <blockquote>
    <p>org.apache.jasper.JasperException: file:
    ...Struts/Struts/build/web/ReverseEx.jsp(10,0) PWC6032: Unable to load
    tag handler class "mytag.StringReverseTag" for tag "jen:string"
    org.apache.jasper.JasperException:  PWC6032: Unable to load tag
    handler class "mytag.StringReverseTag" for tag "jen:string"
    ...Struts/Struts/build/web/ReverseEx.jsp(10,0)
    ...Struts\Struts\nbproject\build-impl.xml:924: Java returned: 1 BUILD
    FAILED (total time: 2 seconds)</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>