Hi all,
I have the tld, descriptor and the jsp file,please let me know why the error is coming
Content of test-taglib.tld
<?xml version="1.0" encoding="ISO-8859-1" ?>
<taglib>
<!-- after this the default space is
"http://java.sun.com/j2ee/dtds/jsptaglibrary_1_2.dtd"
-->
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>test</shortname>
<info>
A tag library from Core Servlets and JavaServer Pages,
http://www.coreservlets.com/. </info>
<tag>
<name>required</name>
<tagclass>TestTag</tagclass>
<info>Simplest example: inserts one line of output</info>
<bodycontent>EMPTY</bodycontent>
</tag>
<!-- Other tags defined later... -->
Content of the descriptor file RequiredTag.java
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
public class RequiredTag implements Tag
{
private PageContext pageContext;
private Tag parentTag;
public void setPageContext(PageContext pageContext){
this.pageContext = pageContext;
}
public void setParent(Tag parentTag){
this.parentTag = parentTag;
}
public Tag getParent(){
return this.parentTag;
}
public int doStartTag() throws JspException{
try{
JspWriter out = pageContext.getOut();
out.print("<font color='#ff0000'>*</font>");
}catch(Exception e){
throw new JspException("error in RequiredTag.doStartTag()");
}
return SKIP_BODY;
}
public int doEndTag() throws JspException{
return EVAL_PAGE;
}
public void release(){}
}
Content of the TestTaglib.jsp
<html>
<head>
<%@ taglib prefix="test" uri="test-taglib.tld" %>
Name:<test:required /><input type=text name="name">
Password:<test:required /><input type=password name="password">
</head>
</html>
I am getting internal server error 500, please help why this error is coming