File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiling JSP+ Tag in Tomcat 4.0.3/Forte IDE 2.0

 
Gabriel Fox
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, i have been battling with this for days
now, trying to compile my HelloWorld JSP which
contains a custom tag , but i keep getting this error :
HelloJSP.jsp [4:9] Unable to open taglibrary http://jakarta.apache.org/taglibs/utilitytags : Could not locate TLD META-INF/taglib.tld
On trying to view from browser , even without compiling i got this :
org.apache.jasper.JasperException: This absolute uri (http://jakarta.apache.org/taglibs/utilitytags) cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:194)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
NOTE : I am using TOMCAT 4.0.3
Am i leaving something undone.All ideas will be
appreciated.
 
Ravi Veera
Ranch Hand
Posts: 127
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two things that you need to verify.
1. Check your web.xml file to verify that you have specified the location of your tld file
Here's an example.
<taglib>
<taglib-uri>/dataSample</taglib-uri>
<taglib-location>
/WEB-INF/tlds/LTDbBean-taglib.tld
</taglib-location>
</taglib>
2.Make sure you have the tld file within in the WEB-INF directory(where you have specified it).
 
Gabriel Fox
Ranch Hand
Posts: 170
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am still in a fix . I used a different Custom Tag from adifferent book but still same error :
1.de/gehe/uk/rms/RMSAccess/JavaScriptTag_Example.jsp [8:4] Unable to open taglibrary http://www.jspinsider.com/jspkit/javascript : Could not locate TLD META-INF/taglib.tld , on conpiling
2.On viewing from browser i got This : org.apache.jasper.JasperException: XML parsing error on file /Web-inf/tlds/JavaScriptExampleTag.tld: Invalid PUBLIC ID: -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2 //EN
at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:226)
at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:283)
at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:219)
at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1164)
at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:758)
at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:121)

Please, i am pasting my web.xml and xxx.tld below .Please help :
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

<taglib>
<taglib-uri>
http://www.jspinsider.com/jspkit/javascript
</taglib-uri>
<taglib-location>
/Web-inf/tlds/JavaScriptExampleTag.tld
</taglib-location>
</taglib>
</web-app>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2 //EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd" >
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>JavaScriptExampleTag</short-name>
<uri> http://www.jspinsider.com/jspkit/javascript</uri>
<description> A Simple Javascript Tag</description>
<tag>
<name>message</name>
<tag-class>de.gehe.uk.rms.RMSAccess.JavaScriptExampleTag</tag-class>
<info> A Simple Javascript Tag </info>
</tag>
</taglib>

NOTE : I am using TOMCAT 4.0.3
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Can you use remote tag libs like that, just by putting a URL for the URI?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic