Hi!
I've been working with Myfaces-1.1.5 for some time, but now decided to change
to the 1.2 implementation, with myfaces-1.2.3 jars.
I've had no problems in creating and deploying an application, but suddenly I
hit a problem I don't understand
I wanted to create a component programmatically (HtmlCommandLink), and set the
action with the MethodBinding, as I've always done in myfaces-1.1.5:
MethodBinding methodBinding =
FacesContext.getCurrentInstance().getApplication().createMethodBinding(
"#{myHandler.myAction}",null);
htmlCommandLink.setAction( methodBinding )
But then my IDE (Eclipse) reported this method (createMethodBinding) as
deprecated. I had a look at the javadoc following the myfaces-1.2.3 bin, and
from what I could understand there is a new way of doing this. Application
interface should have a method getExpressionFactory() from which you would
call the method createMethodExpression( ELContext, String, Class, Class[])
But if I retrieve the Application object from my facesContext, I don't see this
method. I only see the methods that I also did in myfaces-1.1.5, but the
createMethodBinding() is now listed as deprecated. And I can't find
ExpressionFactory in the list of possible classes either. I have had a look at
the source of 1.2.3, and for what I can understand the ApplicationImpl provide
this and other missing methods. The Application interface provides the methods
as well, but throws UnsupportedOperationExceptions on those methods.
Am I the stupid one here missing something obvious? Should I add some other
libraries to use myaces-1.2.3, or are there any explanations to why I have
this problem?
Do I need to create my own implementation of the Application interface?
Hope to have some quick answers to this one, because I'm really getting stuck
here. J
Regards,
Eivind Rønnevik