I am pretty much newbie to Java/JSF technology and I've been trying to do simple UIs to understand how things are going on in Java/JSF world.
Now I want to bind a ManagedBean's method with its package name to a CommandButton's actionListener.
Example:
index.xhtml
...
<h:commandButton actionListener="#{com.acme.myclass.MyMethod}" ...
...
MyClass.java
package com.acme;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
@ManagedBean
@RequestScoped
public class MyClass {
public MyClass() {
// Constructor
}
public void MyMethod() {
// Do some job
}
}
I tried to bind the method as the given example above but the method is not called. Besides I don't see my packages in Netbeans's little autocomplete window. If I bind the method in #{class.method} format (as all given examples on the internet) it works.
Is there a way to achieve this?
Why do I need to do this?
While projects are getting larger and larger naming classes getting harder and harder. So, I think that same class names in different packages make life easier.