Newbie - problem with JSP tag libraries

Discussion in 'Java' started by zalek, Jul 16, 2008.

  1. zalek

    zalek Guest

    Hello,

    I am trying to execute on a JSP program on a server with jakarta-
    tomcat-4.1.29.
    Here is a program:

    <%@ taglib uri="testTagURL" prefix="testTagPrefix" %>
    <testTagPrefix:myFirstTag/>

    in web.xml I have definition:

    <taglib>
    <taglib-uri>testTagURL</taglib-uri>
    <taglib-location>/WEB-INF/tld/testTag.tld</taglib-location>
    </taglib>

    I have testTag.tld file located at: /WEB-INF/tld

    When I execute my program I am getting:

    org.apache.jasper.JasperException: File "/test-jsp/testTagURL" not
    found
    at
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:
    105)
    at
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:
    430)
    at
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:
    154)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.
    (TagLibraryInfoImpl.java:180)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:
    354)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381)

    My question: how my program is looking for "/test-jsp/testTagURL" and
    not for "/WEB-INF/tld/testTag.tld"?

    Thanks,

    Zalek
     
    zalek, Jul 16, 2008
    #1
    1. Advertising

  2. zalek

    zalek Guest

    On Jul 15, 7:39 pm, zalek <> wrote:
    > Hello,
    >
    > I am trying to execute on a JSP program on a server with jakarta-
    > tomcat-4.1.29.
    > Here is a program:
    >
    > <%@ taglib uri="testTagURL" prefix="testTagPrefix" %>
    > <testTagPrefix:myFirstTag/>
    >
    > in web.xml I have definition:
    >
    > <taglib>
    > <taglib-uri>testTagURL</taglib-uri>
    > <taglib-location>/WEB-INF/tld/testTag.tld</taglib-location>
    > </taglib>
    >
    > I have testTag.tld file located at: /WEB-INF/tld
    >
    > When I execute my program I am getting:
    >
    > org.apache.jasper.JasperException: File "/test-jsp/testTagURL" not
    > found
    > at
    > org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:
    > 105)
    > at
    > org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:
    > 430)
    > at
    > org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:
    > 154)
    > at org.apache.jasper.compiler.TagLibraryInfoImpl.
    > (TagLibraryInfoImpl.java:180)
    > at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:
    > 354)
    > at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381)
    >
    > My question: how my program is looking for "/test-jsp/testTagURL" and
    > not for "/WEB-INF/tld/testTag.tld"?
    >
    > Thanks,
    >
    > Zalek


    I found the problem. I changed the order of web.xml parms:
    This did not work:

    <web-app>

    <taglib>
    <taglib-uri>testTagURL</taglib-uri>
    <taglib-location>/WEB-INF/tld/testTag.tld</taglib-location>
    </taglib>

    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

    </web-app>

    This worked:

    <web-app>

    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

    <taglib>
    <taglib-uri>testTagURL</taglib-uri>
    <taglib-location>/WEB-INF/tld/testTag.tld</taglib-location>
    </taglib>


    </web-app>

    Zalek
     
    zalek, Jul 17, 2008
    #2
    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. GA
    Replies:
    0
    Views:
    856
  2. jstack
    Replies:
    1
    Views:
    651
    Tor Iver Wilhelmsen
    Jul 4, 2003
  3. JStrummer

    JSP / Custom Tag Libraries

    JStrummer, May 20, 2004, in forum: Java
    Replies:
    3
    Views:
    609
    kaeli
    May 20, 2004
  4. shruds
    Replies:
    1
    Views:
    963
    John C. Bollinger
    Jan 27, 2006
  5. Replies:
    5
    Views:
    525
Loading...

Share This Page