webwork/src/main/webwork/view/taglib BeanTag.java,1.8,1.9

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

Modified Files:
	BeanTag.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: BeanTag.java
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/main/webwork/view/taglib/BeanTag.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- BeanTag.java	4 Dec 2003 07:20:00 -0000	1.8
+++ BeanTag.java	17 Jan 2005 07:28:12 -0000	1.9
@@ -7,10 +7,10 @@
 package webwork.view.taglib;
 
 import webwork.util.BeanUtil;
+import webwork.util.injection.ObjectFactory;
 
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.PageContext;
-import java.beans.Beans;
 
 /**
  * Instantiate a JavaBean.
@@ -19,7 +19,7 @@
  * It is lazily executed, which means that you can set parameters
  * by using the "param" tag.
  *
- *	@author Rickard Öberg ([email protected])
+ *	@author Rickard Őberg ([email protected])
  *	@version $Revision$
  */
 public class BeanTag
@@ -89,6 +89,6 @@
 
    protected Object loadBean(String name) throws Exception
    {
-     return Beans.instantiate(Thread.currentThread().getContextClassLoader(), name);
+     return ObjectFactory.instantiateBean(Thread.currentThread().getContextClassLoader(), name);
    }
 }



-------------------------------------------------------
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