我要做一个标签,能够使用El表达式但是写完了不知道问题出在什么地方了.
javax.servlet.ServletException: javax/servlet/jsp/JspException
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.HTML.testTag_jsp._jspService(testTag_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
root cause 
java.lang.NoClassDefFoundError: javax/servlet/jsp/JspException
tld.TestTag.setIOValue(TestTag.java:27)
org.apache.jsp.HTML.testTag_jsp._jspx_meth_tld_pagination_0(testTag_jsp.java:95)
org.apache.jsp.HTML.testTag_jsp._jspService(testTag_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

解决方案 »

  1.   

    下面的是我的源码:package tld;import java.io.IOException;import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspWriter;
    import javax.servlet.jsp.tagext.TagSupport;
    import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;/**
     * @author Administrator
     * @version 1.0 2005-10-26 8:40:32
     * @function - 标签的测试类
     */
    public class TestTag extends TagSupport {    private Object IOValue = null;    public void setIOValue(Object IOValues) throws JspException {
            this.IOValue = ExpressionEvaluatorManager.evaluate("IOValues", IOValues
                    .toString(), Object.class, this, pageContext);
        }    public int doStartTag() {        try {
                JspWriter out = pageContext.getOut();
                out.print(IOValue.toString());
            } catch (IOException e) {
                System.out.println(e.getMessage());
            }        return EVAL_PAGE;
        }}
      

  2.   

    这个是我JSP页面的源码:
    <%@ page language="java" %>
    <%@ taglib uri="/WEB-INF/tld/TestTld.tld" prefix="tld" %>
    <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    <title>Lomboz JSP</title>
    </head>
    <body bgcolor="#FFFFFF">
    <%request.setAttribute("value","attribute");%>
    print is:<tld:pagination IOValue="${value}" /></body>
    </html>
      

  3.   

    这个是tld配置文件的源码:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
      PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
      "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
     <tlib-version>1.0</tlib-version>
     <jsp-version>1.2</jsp-version>
     <short-name>TLD</short-name> 
     <tag>
      <name>pagination</name>
      <tag-class>tld.TestTag</tag-class>
      <body-content>empty</body-content>
      <attribute>
       <name>IOValue</name>
       <required>false</required>
       <rtexprvalue>true</rtexprvalue>
      </attribute>
     </tag>
    </taglib>
      

  4.   

    ExpressionEvaluatorManager这个类Not Found