webwork/src/main/webwork/view/taglib ActionTag.java,1.19,1.20

[email protected] Sat, 12 Jun 2004 15:47:05 -0700
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-serv25086

Modified Files:
	ActionTag.java 
Log Message:
Fixed issue WW-378 where the action was not executed when
accessed.

Index: ActionTag.java
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/main/webwork/view/taglib/ActionTag.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- ActionTag.java	17 Jun 2003 15:41:12 -0000	1.19
+++ ActionTag.java	12 Jun 2004 22:47:03 -0000	1.20
@@ -56,10 +56,15 @@
       	   log.error(msg, t);
       	   throw new JspException(msg + ", throwable: " + t);
         }
-
         if (getId() != null) {
-           pageContext.setAttribute(getId(), bean);
-           pageContext.setAttribute(getId(), bean, PageContext.REQUEST_SCOPE);
+           // The bean variable is needed above so that parameters etc
+           // can be set on the action.
+           // Now we need to get the ValueHolder object from the stack
+           // and store it in the pageContext so that the action can be
+           // executed before it is accessed.
+           Object lazyValueHolder = getStack().peek();
+           pageContext.setAttribute(getId(), lazyValueHolder);
+           pageContext.setAttribute(getId(), lazyValueHolder, PageContext.REQUEST_SCOPE);
         }
 
         return EVAL_BODY_INCLUDE;



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504