Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1.3
-
None
-
Windows 2000 SP4, JBoss 4.0.3
Description
The TabChangeListenerTag class in its current implementation creates always a new instance of the application's TabChangeListener implementation. Thus you cannot provide a preinitialized instance - for example a request configured in faces-config.xml or a Spring bean. Instance reuse is not possible.
It wants a classname of the TabChangeListener implementation class and creates an instance. Even given a JSF expression it doesn't get the instance pointed to by the expression but interprets the expression result as a class name to be instantiated:
String className;
if (UIComponentTag.isValueReference(type))
else
{ className = type; } TabChangeListener listener = (TabChangeListener) ClassUtils.newInstance(className);
((HtmlPanelTabbedPane) component).addTabChangeListener(listener);
It could be made better by using something like that:
Object refValue = valueBinding.getValue(facesContext);
if (refValue instanceof TabChangeListener)
else
{ // use the instance found as a class name to be instantiated }