Help coderanch get a
new server
by contributing to the fundraiser
  • 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin


Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pls go through the foll code.
Iam creating a custom defined tag and calling in my JSP.
The taglibclass
import javax.servlet.jsp.*;
import javax.servlet.*;
public class taglibclass extends javax.servlet.jsp.tagext.TagSupport
public int doStartTag() throws JspException
return 1;
The .tld file
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "" >
<info>An example tag library</info>
<info>Works out how large a file, pointed to by a URI, is in bytes</info>
And web.xml file
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN" "">


The JSP file where iam calling custom tag
<%@ taglib uri="/Web-inf/classes" prefix="examples" %>
With out defining the tag itself its not recognising the uri.
I have set the docroot for weblogic as myserver/servletclasses and i have created this web-inf dir in that and kept taglib class file in classes dir of web-inf dir.And i kept web.xml,.tld files in web-inf dir.And JSP file in myserver/servletclasses dir.
Pls correct my code..
Ravi Vunnam.
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can see about 5 things wrong with your listing without even trying very hard.
I suggest getting a book on how to create Custom tags or going through Sun's TagLib tutorial.
Yes, my master! Here is the tiny ad you asked for:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic