Newbie - problem with JSP tag libraries

Z

zalek

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
 
Z

zalek

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top