hello sir
i m using
tomcat and new to JSTL , sir i have my
JSP file as follows ...
t2_final.jsp
<!-- JAI SHRI RAM -->
<%@ taglib uri="first_taglib.tld" prefix="ram" %>
<HTML>
<HEAD>
<TITLE>JAI SHRI RAM</TITLE>
</HEAD>
<BODY>
<H1><ram:sita /></H1>
</BODY>
</HTML>
now i have my .TLD file as follows ........
first_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">
<!-- a tag library descriptor -->
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>ram</shortname>
<info>
A tag library from Core
Servlets and JavaServer Pages,
http://www.coreservlets.com/. </info>
<tag>
<name>sita</name>
<tagclass>t2</tagclass>
<bodycontent>EMPTY</bodycontent>
<info>Simplest example: inserts one line of output</info>
</tag>
<!-- Other tags defined later... -->
</taglib>
and my class file is as follows .......
t2.java
//JAI SHRI RAM
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.io.*;
public class t2 extends TagSupport {
public int doStartTag() {
try {
JspWriter out = pageContext.getOut();
out.print("Custom tag example " +
"(coreservlets.tags.ExampleTag)");
} catch(IOException ioe) {
System.out.println("Error in ExampleTag: " + ioe);
}
return(SKIP_BODY);
}
}
i have complied my file and get the class file successfuly and i have all the files in tomcat4.1\webapps\root\ .but when i am running it through browser then it is giving the error in the JSP file i.e ts_final, that it is unable to compile .... please tell me that why this error is coming/..
thanks for help
gaurav
t2.javafirst_taglib.tldt2_final.jsp