• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Taglib uri..problem..(need help)

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have created a simple ExampleTag and I am not able to run it from ExampleTag.jsp.I am getting Internal Server Error as jsp-taglib.tld not found.
Below is my directory structure..
devel (Web application directory)
jsp
ExampleTag.jsp
Tags
ExampleTag.java
WEB-INF
tlds
jsp-taglib.tld
classes
moreservlets
tags
ExampleTag.class

my jsp-taglib.tld file is
<?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/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<shortname>devel-tags</shortname>
<info>A tag library form more servlets and java server pages</info>
<tag>
<name>example</name>
<tagclass>moreservlets.tags.ExampleTag</tagclass>
<bodycontent>empty</bodycontent>
<info>Simplest example:inserts one line of output</info>
</tag>
</taglib>
Jsp taglib uri is
<%@ taglib uri="/tlds/jsp-taglib.tld" prefix="devel" %>
I am using jdk1.4 and tomcat4.0.4
Please correct me where I am wrong..
I think there is problem in taglib uri..If so what should be the uri for my directory structure?
Thanks,
Radhika
SCJP
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's hard to tell due to the lack of formatting in your post, but if the tld folder is under your WEB-INF folder, you need to include that in the path.
hth,
bear
 
Radhika Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Hope this format helps you to better understand ..
devel (Web application directory)
/jsp
//ExampleTag.jsp
/Tags
//ExampleTag.java
/WEB-INF
//tlds
///jsp-taglib.tld
//classes
///moreservlets
////tags
/////ExampleTag.class
Jsp taglib uri is
<%@ taglib uri="/tlds/jsp-taglib.tld" prefix="devel" %>
I have included tlds in the uri path but I am getting error "/tlds/jsp-taglib.tld" not found
Radhika
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Bear suggested, try the following...
<%@ taglib uri="/WEB-INF/tlds/jsp-taglib.tld" prefix="devel" %>
HTH
Simon
 
Radhika Reddy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Simon,
Now error was gone but its not displaying anything.In view /source I can see custom tag execution but its not displayed on the browser..
here is code for jsp file..
<html>
<head>
<title>Example<title>
</head>
<body>
<%@ taglib uri="/WEB-INF/jsp/msajsp-taglib1.tld" prefix="devel" %>
<h1>Example Tag using custom tags</h1>
<h1><devel:example/></h1>
<devel:example/>
</body>
</html>
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you see the taglibs in the source of your html, then it was not parsed by your container.
try
<%@ taglib uri="/WEB-INF/tlds/jsp-taglib.tld" prefix="devel" %>
 
reply
    Bookmark Topic Watch Topic
  • New Topic