On our web-application, we did some refactoring on the Java beans, and due to this refactoring, some actions / getters are not available anymore. For example, in the following example:
public class MyBean implements Serializable {
// Old name
// public String getFoo() { return "foo"; }
// New name
public String getBar() { return "bar"; }
}
If my JSF code still looks like:
<h:inputText value="#{myBean.foo}" .../>
then it will generate an exception.
My main concern is that some of the EL expressions may now point to unexisting methods on the Java bean, and I am only able to see that when I browse the adequate page. It becomes harder when the EL expression is located in a part that is rendered on specific conditions and / or rerender by Ajax.
So my question is how can I check statically the correctness of these EL expressions?
I've checked the JSFUnit tool as it provides such utility. So I tried this example, but it doesn't seem to work as expected. On a simple test page, with few EL expressions (some correct, some others wrong with unexisting beans and / or methods), the test succeed, which is not correct.
A really important note: My beans are defined in my Spring configuration, and not in the faces-config.xml
.
Also note that I just need to check if the EL expression refers to an existing bean and method, and not necessarily that this action will be executed correctly...
Technical information:
Java 1.6, Spring 2.5, JSF 1.2, EL Functor, Facelets and Richfaces 3.3