According to java ee 5 api ExpressionFactory provides a method #newInstance.
I’m using the official javaee-api available in maven: Java EE 5 APIs now in a Maven repository…
But this jar does not provide this method. So I get compiler errors.
How can I get a compilable version without using javaee implementations like e.g. glassfish, openejb?
The official Java EE 6.0 jar provided by maven (java.dev.net) contains this method.
Well, javadoc is not a proof and, actually, this is very likely an error in the Java EE 5 javadoc. The two
newInstance()factory methods have been added in the Maintenance Review 1 of the JSR-245 (to make EL standalone and take it out of JSP 2.1, have a look at the JSR-245 MR1 Change Log for the details) but that review has never been released.So it’s not surprising that you don’t find this method in the java-ee bundle available in the java.net repo.
As expected. This method is not in Java EE 5 (at least this is my understanding). So you need to use:
Yes, because this is Java EE 6, because EL is now standalone, with its own specification (technically, EL is still in JSR-245, sorry if this is confusing). So Java EE 6 includes EL 2.2 (yes, the version jumped from 1.1 to 2.1.2 and then 2.2 for a better alignment with the JSP version). And this version does expose the
newInstance()methods onExpressionFactory.