tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viktor Gars" <viktor.g...@telia.com>
Subject NoClassDefFoundError: JspContext when using pageContext.getOut()
Date Mon, 24 Feb 2003 22:16:36 GMT
Hi

I have a tag that contins this code
----------
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
public class TestTag extends TagSupport
{
public int doEndTag()
throws JspTagException
{
try
{
pageContext.getOut().print("Hello!");
}
catch(Exception e)
{
}
return(EVAL_PAGE);
}
}
----------
and the tld and web.xml looks like this
----------
<?xml version="1.0"?>
<!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>test TLD</shortname>
<tag>
<name>testtag</name>
<tagclass>TestTag</tagclass>
</tag>
</taglib>
----------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<taglib>
<taglib-uri>/test</taglib-uri>
<taglib-location>/WEB-INF/tld/test.tld</taglib-location>
</taglib>
</web-app>
----------
and the JSP that call that uses the tag looks like this
---------
<%@ taglib prefix="test" uri="/test" %>
<test:testtag/>
---------
everything is very basic. But when I try to run this code I get this error
message
---------
exception
javax.servlet.ServletException: javax/servlet/jsp/JspContext
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

root cause java.lang.NoClassDefFoundError: javax/servlet/jsp/JspContext
 at java.lang.Class.getDeclaredMethods0(Native Method)
 at java.lang.Class.privateGetDeclaredMethods(Class.java:1627)
-------

I have located the error (my normal tag is much bigger) to the
pageContext.getOut() function, every other function seems to work ok with
pageContext, I dont get any error messages when using getAttribute,
setAttribute, getSession and setSession.
I have looked in the jar files in Tomcats lib dir to se if I can find
JspContext but I have not found it so I relay dont know what is happening. I
hope anyone here knows :)

I use Tomcat 4.1.18, Java 1.4.1_01, Windows XP, J2EE 1.4.0 - BETA

Regards

Viktor Gars


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message