自定义标志问题
如果我的标志处理器文件如下:
import java.io.IOException;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import java.util.*;
public class JsExampleTag extends BodyTagSupport
{
public JsExampleTag()
{
}
public int doEndTag() throws JspTagException
{
String ls_alert="";
try
{
BodyContent bc=getBodyContent();
if (bc!=null)
{
String ls_message=bc.getString();
JsExample js=new JsExample();
ls_alert=js.alert(ls_message.trim());
}
pageContext.getOut().write(ls_alert);
}
catch (IOException e)
{
throw new JspTagException("error"+e.toString());
}
return EVAL_PAGE;
}
}
他的JsExampleTag.class文件存在C:\tomcat-4.0\webapps\ROOT\WEB-INF\classes
如何写JsExampleTag.tld文件。
我写的JsExampleTag.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">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>Js</shortname>
<info>this is test tag library!</info>
<tag>
<name>message</name>
<tagclass>JsExampleTag</tagclass>
<info>alert</info>
</tag>
</taglib>
但是系统提示如下错误:
An error occurred at line: 5 in the jsp file: /tag.jsp
Generated servlet error:
C:\tomcat-4.0\work\Standalone\localhost\_\tag$jsp.java:59: Class org.apache.jsp.JsExampleTag not found.
JsExampleTag _jspx_th_JavaScript_message_0 = new JsExampleTag();
^
An error occurred at line: 5 in the jsp file: /tag.jsp
Generated servlet error:
C:\tomcat-4.0\work\Standalone\localhost\_\tag$jsp.java:59: Class org.apache.jsp.JsExampleTag not found.
JsExampleTag _jspx_th_JavaScript_message_0 = new JsExampleTag();
请问各位如何解决,一定给分