webwork/src/main/webwork/util BeanUtil.java,1.41,1.42

[email protected] Sun, 16 Jan 2005 23:28:14 -0800
Newsgroups gmane.comp.java.open-symphony.cvs
Message-ID <[email protected]>
Update of /cvsroot/opensymphony/webwork/src/main/webwork/util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18098/src/main/webwork/util

Modified Files:
	BeanUtil.java 
Log Message:
Allow instantiation of classes to be pluggable from within webwork.
This allows you to use Pico or Spring to instantiate the webwork classes
that you need.

This is especially useful for instantiating beans in web pages (using
<webwork:bean..>

There is a new property 'webwork.injection.objectcreator' that you can
specify to load a class to instantiate your objects.

Note that other object loaded directly through the webwork.properties
file are not passed through this object creation process.

Fixes WW-723


Index: BeanUtil.java
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/main/webwork/util/BeanUtil.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- BeanUtil.java	10 Aug 2004 14:57:27 -0000	1.41
+++ BeanUtil.java	17 Jan 2005 07:28:10 -0000	1.42
@@ -9,6 +9,7 @@
 import webwork.action.IllegalArgumentAware;
 import webwork.action.ValidationEditorSupport;
 import webwork.util.editor.*;
+import webwork.util.injection.ObjectFactory;
 
 import java.beans.*;
 import java.lang.reflect.Method;
@@ -1020,7 +1021,7 @@
             }
          } else
          {
-            return (PropertyEditor) peClass.newInstance();
+            return (PropertyEditor) ObjectFactory.instantiate(peClass);
          }
       } catch (Exception e)
       {



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt