File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp" Watch "jsp" New topic


ram shyam ravi

Joined: Sep 20, 2002
Posts: 14
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.
Rick Hightower
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
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.

Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
I agree. Here's the link:
subject: jsp
It's not a secret anymore!