2 Replies Latest reply on May 7, 2003 3:22 PM by 843835

    error in tablib by the time of running jsp

    843835
      Hi,

      I am getting the following error when i try to run the jsp using tablibs ...

      Error: 500
      Location: /test/test.jsp
      Internal Servlet Error:

      org.apache.jasper.compiler.CompileException: /usr/tomcat/webapps/test/test.jsp(0,0) Unable to open taglibrary http://123.123.142.156/test/taglib : Parse Error in the tag library descriptor: Illegal character at end of document, <.
           at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:713)
           at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:116)

      Here is my code:
      new-tag file:-

      import javax.servlet.jsp.*;
      import javax.servlet.jsp.tagext.*;

      public class new_tag extends javax.servlet.jsp.tagext.TagSupport
      {
      private String message = "message not available";

      public int doStartTag() throws JspException
      {
      try
      {
      pageContext.getOut().print(message);
      }
      catch (Exception e)
      {
      throw new JspTagException(e.getMessage());
      }
      return SKIP_BODY;
      }

      public void setMessage(String text)
      {
      message = text;
      }
      }
      ********************
      web.xml: -

      <taglib>
      <taglib-uri>http://123.123.142.156/test/taglib </taglib-uri>
      <taglib-location>/WEB-INF/example-taglib.tld</taglib-location>
      </taglib>
      *******************
      example-taglib.tld :--


      <?xml version="1.0" encoding="UTF-8" ?>

      <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
      "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

      <taglib>
      <tlib-version>1.0</tlib-version>
      <jsp-version>1.2</jsp-version>
      <short-name>new_tag</short-name>
      <uri>/new_tag</uri>
      <description>Info about the new tag</description>
      <tag>
      <name>new_tag</name>
      <tag-class>new_tag</tag-class>
      <body-content>JSP</body-content>
      <attribute>
      <name>message</name>
      <required>false</required>
      <rtexprvalue>true</rtexprvalue>
      <type>String</type>
      </attribute>
      </tag>
      </taglib>
      ************************
      test.jsp

      <%@ taglib uri="http://123.123.142.156/test/taglib" prefix="ctl" %>
      <HTML>
      <ctl:new_tag message="Creating a new function with JSP"></ctl:new_tag>
      </HTML>

      Any help please ...

      tahnks.