Article View: comp.lang.java.programmer
Article #471Re: Newbie - problem with JSP tag libraries
From: zalek
Date: Thu, 17 Jul 2008 11:07
Date: Thu, 17 Jul 2008 11:07
80 lines
3515 bytes
3515 bytes
On Jul 15, 7:39 pm, zalek <zalekbl...@hotmail.com> 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
Technical Details
Message-ID:
<dab66bd8-37ac-4c0f-8f20-4ef3bec38ab5@s50g2000hsb.googlegroups.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!s50g2000hsb.googlegroups.com!not-for-mailReferences:
<c038fd11-3290-461a-a5f7-c75973412b45@27g2000hsf.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10a146,2c05585d7a7cd1b2 X-Google-Thread: 10026d,2c05585d7a7cd1b2 X-Google-Thread: f4be4,2c05585d7a7cd1b2 X-Google-Attributes: gid10a146,gid10026d,gidf4be4,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!s50g2000hsb.googlegroups.com!not-for-mail From: zalek <zalekbloom@hotmail.com> Newsgroups: comp.lang.java.programmer,weblogic.developer.interest.jsp,borland.public.jbuilder.servlets-jsp Subject: Re: Newbie - problem with JSP tag libraries Date: Thu, 17 Jul 2008 04:07:43 -0700 (PDT) Organization: http://groups.google.com Lines: 80 Message-ID: <dab66bd8-37ac-4c0f-8f20-4ef3bec38ab5@s50g2000hsb.googlegroups.com> References: <c038fd11-3290-461a-a5f7-c75973412b45@27g2000hsf.googlegroups.com> NNTP-Posting-Host: 64.131.221.61 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1216292863 4124 127.0.0.1 (17 Jul 2008 11:07:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 Jul 2008 11:07:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s50g2000hsb.googlegroups.com; posting-host=64.131.221.61; posting-account=5f_t8QoAAAAHROTCVItSGRlwRwFTIvKy User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15,gzip(gfe),gzip(gfe)