views:

1019

answers:

3

I am trying to set a variable that I will refer to in a custom JSP tag, so I have something like this in my JSP:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="path" value="test"/>

However, I am getting this error when The JSP runs:

java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
    at org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.java:140)

I am running Tomcat 5.5, and Java 1.5, with JSTL 1.2.

Am I doing something wrong here?

Thanks!

+1  A: 

Looks like you may have some versioning problem, maybe a conflicting jar file of some sort. Look here, maybe it'll help. You need to supply some more info about your runtime environment if you can't solve it.

krosenvold
Thanks for the tip. I think the problem is I am using JSTL 1.2, but Tomcat 5.5, so that is the mismatch.
pkaeding
A: 

i am also facing the same problem. my c:foreach is not working, the same exception is being thrown. whilw c:out and c:set etc are working properly

Yes, I had a version mismatch in my libraries. If you check out the link in the accepted answer, perhaps that will help!
pkaeding
+1  A: 

Tomcat 5.5 does not support Servlet API 2.5 which is used by JSTL 1.2.

Upgrade to Tomcat 6.0 or downgrade the Servlet / JSP / JSTL versions.

see http://tomcat.apache.org/whichversion.html

arturh