taglibs ? where to put taglib classes ?

Discussion in 'Java' started by raptor, Jul 10, 2005.

  1. raptor

    raptor Guest

    hi,

    I dwelwing with this whole day. I'm using Netbeans but also tried
    manualy.So what I've done :

    1. created in WEB-INF/tags/mytags.tld a tag called xxx(via netbeans
    interface). snippet :

    ....
    <taglib ...>
    ...
    <tag>
    <name>xxx</name>
    <tag-class>my.XxxTag</tag-class>
    <body-content>empty</body-content>
    <display-name></display-name>
    <small-icon></small-icon>
    <large-icon></large-icon>
    <description></description>
    <example></example>
    </tag>
    </taglib>

    2. Here is the .jsp page
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="my.*"%>
    <%@taglib prefix="mytags" tagdir="/WEB-INF/tags" %>
    <html>
    <head><title>JSP Page</title></head>
    <body>
    <mytags:xxx/>
    </body>
    </html>


    3. with netbeans3.6 interface I generated the code i.e. the "class
    xxx". (jsp1.2)
    I also tried the jsp2.0 way i.e suppling only doTag() method.
    Code snippet :
    package my;

    public class XxxTag extends BodyTagSupport {
    .....


    4. I tried to deploy the library as described int the netbeans docs
    - generate jar,compile,cut/paste in WEB-INF/lib
    I also tried to manualy symlink WEB-INF/classes/my to WEB-INF/tags/my
    (where the code reside)
    I also tied to copy the class in classes dir...etc.etc...

    But I still get :

    org.apache.jasper.JasperException: /test2.jsp(15,0) No tag "xxx"
    defined in tag library imported with prefix "mytags"
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:200)
    org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1308)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1560)
    org.apache.jasper.compiler.Parser.parse(Parser.java:126)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)



    Do u have any idea how to solve this problem..i've tried other things
    too, several times starting from scractch but doesnt seem to work
     
    raptor, Jul 10, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. charly

    taglibs and limits : HELP !!

    charly, Dec 6, 2003, in forum: Java
    Replies:
    0
    Views:
    522
    charly
    Dec 6, 2003
  2. Boni Gopalan

    Nested Tags : Jakarta Taglibs

    Boni Gopalan, Apr 29, 2004, in forum: Java
    Replies:
    1
    Views:
    586
    Christophe Vanfleteren
    Apr 29, 2004
  3. Huzefa
    Replies:
    1
    Views:
    379
    Chris Smith
    Aug 20, 2004
  4. Dale
    Replies:
    0
    Views:
    3,401
  5. fishfry

    JSTL or Struts taglibs?

    fishfry, Apr 2, 2005, in forum: Java
    Replies:
    2
    Views:
    2,671
    Tim Slattery
    Apr 5, 2005
Loading...

Share This Page