HI
learning the concepts of caustom tags. I got an error in
jsp page that :"WEB-INF/tlds/taglib.tld "not found
below are the files
1.teglib.tld
2.sample.jsp
3.taghandler file
4.xml file
1.<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" 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">
<tlib-version>1.0</tlib-version>
<short-name>taglib</short-name>
<uri>/WEB-INF/tlds/taglib</uri>
<tag>
<name>myTag</name>
<tagclass>Testpac.MyCustomTag</tagclass>
</tag>
2.<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
<%@ taglib uri="/myTLD" prefix="easy"%> *** Im getting error at this point.
<easy:myTag>hi this is lokesh</easy:myTag>
</head>
<body>
<h1>JSP Page</h1>
</body>
</html>
3.package Testpac;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
/**
*
* @author stupa002
*/
public class MyCustomTag extends TagSupport {
public int doEndTag() throws JspException {
JspWriter out = pageContext.getOut();
try {
out.println("Hello from the custom tag.");
}
catch (Exception e) {
}
return super.doEndTag();
}
}
4.
<web-app>
<display-name>template</display-name>
<taglib>
<taglib-uri>/myTLD</taglib-uri>
<taglib-location>/WEB-INF/tlds/taglib.tld</taglib-location>
</taglib>
</web-app>
[ January 24, 2008: Message edited by: lokesh rajarathnam ]