} now when i try to access the page i am getting following error: org.apache.jasper.JasperException: Unable to open taglibrary taglib.tld : Unable to open the tag library descriptor: Stream closed. can anybody help please
I think the .tld file should be in a different directory than your JSP file. The JSP file is usually at your web application's root, while the .tld file should be in the web-inf directory under that root. Your tag class whould then go in the web-inf\classes directory. Try that and see if that works. Brian
Hi Brian thanks for reply.Please have look at following part from jsp1.1 spec Case C - <%@ taglib uri="NOROOT_REL_URI" prefix="foo" %> where NOROOT_REL_URI is a relative URI that does not start with "/" 1 Look in the processed web.xml for a taglib entry whose TAGLIB_URI is NOROOT_REL_URI. 2a If found, the TABLIB_LOCATION for the taglib entry is the value to assign to TLD_URI. 2b If no such entry is found, resolve NOROOT_REL_URI relative to the current JSP page where the directive appears. Let ROOT_REL_URI be the resolved value (this is a relative URI specification that starts with "/" - by definition-). ROOT_REL_URI is the value to assign to TLD_URI. 3 Use TLD_URI to locate the TLD (see issue 9). If the TLD cannot be located a translation error is raised. Issue 9 � Taglib directive: Locating TLDs This is the second part of how to interpret the uri attribute of a taglib directive. Once the TLD_URI has been resolved according to the resolution of Issue 8, how to locate the TLD. Resolution There are two cases. In both cases the TLD_URI is to be interpreted relative to the root of the Web Application. In the first case the TLD_URI refers to a TLD file directly.. In the second case, the TLD_URI refers to a JAR file. If so, that JAR file should have a TLD at location META-INF/taglib.tld. so when i dont specify entry in web.xml and when .tld is kept in same directory as jsp is then it should work as the root of application is the directory in which jsp is. But it doesnot happen that way. help out guys...
Please note that The Java Ranch has a naming policy, described here and "tsharang" is not a valid name. Presumably you are the same person as "Sharnag Thorat". If so, please use the full name instead of the one word abbreviation. Thanks.
Hi, you can keep your tld file where ever you feel like keeping it by entering in web.xml file. The default location is where your jsp programs is kept. I have corrected the errors in the above program run the following "taglib.tld" <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"> <taglib> <tlibversion>1.0</tlibversion> <jspversion>1.1</jspversion> <shortname>mut</shortname> <uri> </uri> <info> RSExplorer java server pages </info> <tag> <name>HelloWorldTag</name> <tagclass>HelloWorldTag</tagclass>
</tag> </taglib> The error in yours is (a) "Microsystems, Inc./DTD " but should be "Microsystems, Inc.//DTD" (i.e //) (b) remove this item <bodycontent>empty</bodycontent> When you are using <body> of HTML document you can not use "Empty" .
"test.jsp" <html> <head>taglib test</head> <body> <%@taglib uri="taglib.tld" prefix="mut" %> <mut:HelloWorldTag> </mut:HelloWorldTag> </body> <html> You have to use "mut" as prefix as defined in your taglib.tld Remainning are ok. Run your program ,it will be ok now (I verified it) solaiappan
[This message has been edited by P SOLAIAPPAN (edited December 07, 2000).]