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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to