tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45345] New: Methods "javax.el. ExpressionFactory#newInstance" not implemented
Date Sat, 05 Jul 2008 10:24:51 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45345

           Summary: Methods "javax.el.ExpressionFactory#newInstance" not
                    implemented
           Product: Tomcat 6
           Version: 6.0.16
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Servlet & JSP API
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: sguazt@gmail.com


Just experimenting with the creation of JSP custom tags.
I needed to create a ValueExpression throught the ExpressionFactory class but
I've realized the EL implementation included in Apache doesn't include the
methods "newInstance" of the ExpressionFactory.
I've looked inside the SVN repo just to make sure that the implementation
wasn't in development-

These methods are included in the J2EE 5 specs:
http://java.sun.com/javaee/5/docs/api/javax/el/ExpressionFactory.html

So what about this?


** How to reproduce **
Create a JSP custom component, for instance:

--- [snip] ---
public class MyJspTag extends SimpleTagSupport
{
        String bean;
        String name;
        String value;

        //...

        @Override
        public void doTag() throws JspException, SkipPageException, IOException
        {
                ELContext elContext = this.getJspContext().getELContext();

                ExpressionFactory expressionFactory = null;
                ValueExpression valueExpression = null;

                expressionFactory = ExpressionFactory.newInstance();
                valueExpression = expressionFactory.createValueExpression(
                                elContext,
                                "${" + bean + "." + name + "}",
                                Object.class
                );
                valueExpression.setValue(elContext, value);
        }
}
--- [/snip] ---
Compile adding in the classpath I include the JARs el-api.jar, jsp-api.jar,
servlet-api.jar you found in $CATALINA_HOME/lib

The compilation should give you the error:
--- [snip] ---
    [javac] .../MyTag.java:39: cannot find symbol
    [javac] symbol  : method newInstance()
    [javac] location: class javax.el.ExpressionFactory
    [javac]             expressionFactory = ExpressionFactory.newInstance();
    [javac]                                                  ^
    [javac] 1 error
--- [/snip] ---

Thanks!!

-- Marco


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message