From d05a83003e003ea97f95e90048abb367dd7ebcf6 Mon Sep 17 00:00:00 2001 From: Jeremy Grelle Date: Mon, 3 Dec 2007 21:22:24 +0000 Subject: [PATCH] Removing MyFaces dependency --- .../faces/webflow/TreeStructureManager.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/TreeStructureManager.java b/spring-faces/src/main/java/org/springframework/faces/webflow/TreeStructureManager.java index da4f572f..c80ee15d 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/TreeStructureManager.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/TreeStructureManager.java @@ -21,10 +21,12 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import javax.faces.FacesException; import javax.faces.component.UIComponent; import javax.faces.component.UIViewRoot; -import org.apache.myfaces.shared_impl.util.ClassUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.util.ClassUtils; /** * @author Manfred Geiler (latest modification by $Author: dennisbyrne $) @@ -85,7 +87,12 @@ class TreeStructureManager { private UIComponent internalRestoreTreeStructure(TreeStructComponent treeStructComp) { String compClass = treeStructComp.getComponentClass(); String compId = treeStructComp.getComponentId(); - UIComponent component = (UIComponent) ClassUtils.newInstance(compClass); + UIComponent component; + try { + component = (UIComponent) BeanUtils.instantiateClass(ClassUtils.forName(compClass)); + } catch (Exception ex) { + throw new FacesException("Could not restore the component tree structure.", ex); + } component.setId(compId); // children