Using tomcat 5.0.24 This may belong to commons-el Jasper uses the org.apache.commons.el implementation. pageContext.getExpressionEvaluator() returns a org.apache.commons.el.ExpressionEvaluatorImpl From org.apache.commons.el.ImplicitObjects.java (which is the identical to org.apache.taglibs.standard.lang.jstl.ImplicitObjects) static final String sAttributeName = "org.apache.taglibs.standard.ImplicitObjects"; This line fails (ImplicitObjects.java:121) public static ImplicitObjects getImplicitObjects (PageContext pContext) { ImplicitObjects objs = (ImplicitObjects) pContext.getAttribute (sAttributeName, PageContext.PAGE_SCOPE); Trying to cast org.apache.taglibs.standard.lang.jstl.ImplicitObjects to org.apache.commons.el.ImplicitObjects This means I can not use ExpressionEvaluators in my own taglibs.
Hi Trond, Could you give more details on how does it fails? Does it fail when you try to use commons-el in your own tag handler? If so, could you please provide a simple test case (i.e., a tag handler that tries to use commons-el and gets an exception)? TIA, Felipe
Stacktrace java.lang.ClassCastException org.apache.commons.el.ImplicitObjects.getImplicitObjects(ImplicitObjects.java:123) org.apache.commons.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:130) org.apache.jasper.runtime.PageContextImpl.resolveVariable(PageContextImpl.java:833) org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124) org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:140) org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263) org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:190) org.example.StoryTag.setStoryId(StoryTag.java:88) org.apache.jsp.edit.view_jspx._jspx_meth_model_story_0(view_jspx.java:263) ... ... Offending method in StoryTag.java: public void setStoryId(String storyId) throws JspException { try { Long value = (Long) pageContext.getExpressionEvaluator().evaluate(storyId, Long.class, pageContext.getVariableResolver(), null); this.storyId = value; } catch (ELException e) { throw new JspException(e); } } Clumsy coding (first attempt in trying to use EL in custom tags) :-) This is a rather complex Struts application. I can't seem to create a simple test case, but somewhere in the app the pageContext attribute "org.apache.taglibs.standard.ImplicitObjects" is set to an instance of org.apache.taglibs.standard.lang.jstl.ImplicitObjects and later retrieved (in org.apache.commons.el.ImplicitObjects) as an org.apache.commons.el.ImplicitObjects which causes the ClassCastException
*** This bug has been marked as a duplicate of 29402 ***
Changed resolution to INVALID since duplicate bug has been deleted from Bugzilla and leaving as DUPLICATE creates referential integrity issues for the underlying database.