hi.
i'm having some difficulty working with a simple custom tag. when i load the jsp file, i receive a runtime error that reads...
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /MySimplePage.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat\work\Catalina\localhost\myJSPApp\org\apache\jsp\MySimplePage_jsp.java:42: ';' expected
taglib uri="/myTLD" prefix="easy"
^
1 error
here's the tld file
<taglib>
<taglibversion>1.0</taglibversion>
<shortname></shortname>
<name>myTag</name>
<tagclass>com.brainysoftware.MyCustomTag</tagclass>
</taglib>
here's the customtag class
package com.brainysoftware;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
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();
}
}
and finally here's the deployment descriptor web.xml
<display-name>template</display-name>
<taglib>
<taglib-uri>/myTLD</taglib-uri>
<taglib-location>/WEB-INF/taglib.tld</taglib-location>
</taglib>
</web-app>
all the files are in the correct directory structure but i can't seem to find the problem. any help would be appreciated.
i'm having some difficulty working with a simple custom tag. when i load the jsp file, i receive a runtime error that reads...
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /MySimplePage.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat\work\Catalina\localhost\myJSPApp\org\apache\jsp\MySimplePage_jsp.java:42: ';' expected
taglib uri="/myTLD" prefix="easy"
^
1 error
here's the tld file
<taglib>
<taglibversion>1.0</taglibversion>
<shortname></shortname>
<name>myTag</name>
<tagclass>com.brainysoftware.MyCustomTag</tagclass>
</taglib>
here's the customtag class
package com.brainysoftware;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
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();
}
}
and finally here's the deployment descriptor web.xml
<display-name>template</display-name>
<taglib>
<taglib-uri>/myTLD</taglib-uri>
<taglib-location>/WEB-INF/taglib.tld</taglib-location>
</taglib>
</web-app>
all the files are in the correct directory structure but i can't seem to find the problem. any help would be appreciated.