Hi All,
From HFSJ page 503,I implemented all codes .
Taghandler class
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.*;
public class SimpleTagTest1 extends SimpleTagSupport
{
public void doTag() throws JspException,IOException
{
getJspContext().getOut().print("This is simple use of custom tag");
}
}
TLD file
<?xml version="1.0" encoding="ISO-8859-1"?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
<tlib-version>1.2</tlib-version>
<uri>simpleTags</uri>
<tag>
<description>marginally better use of custom tag</description>
<name>simple1</name>
<tag-class>SimpleTagTest1</tag-class>
<body-content>empty</body-content>
</tag>
</taglib>
JSP code
<%@ taglib prefix="myne" uri="simpleTags" %>
<html>
<body>
<myne:simple1 />
</body>
</html>
But after deployment I got following errors:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 5 in the jsp file: /chkSimpleTag.jsp
SimpleTagTest1 cannot be resolved to a type
2:
3: <html>
4: <body>
5: <myne:simple1 />
6: </body>
7: </html>
Can anyone tell me what am I missing?