Actually,
All tags should be checking _only_ in the request scope for a VS. The
reason we don't check ActionContext is that during the first call, even
if there is no valid AC, an AC will be returned by
ActionContext.getContext() due to how the AC is implemented (throwback
from the 1.x days). It is recommend you extend the webwork base tag
classes and use getStack() for all your needs.

This change was needed to make WebWork tags work outside of the action
execution scope, thereby allowing it to work with SiteMesh and generally
outside of an action request.

-Pat

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Frederick N. Brier
Sent: Thursday, November 06, 2003 10:06 PM
To: [EMAIL PROTECTED]
Subject: Re: [OS-webwork] ValueStack being unexpectedly replaced

Ok.  Answered my own question, but should the TagUtils.getStack() check 
for an existing value stack in an existing ActionContext before creating

one (which is, of course, empty)?

Turns out that the Webwork2 Tags extend WebWorkTagSupport and 
WebWorkBodyTagSupport and utilize an accessor that calls the 
TagUtils.getStack() method.  My custom tags extended 
TagSupport/BodyTagSupport and were attempting to access the value stack 
via the ActionContext.  The WW2 PropertyTag was using the 
TagUtils.getStack() which if the property "webwork.valueStack" is not in

the request attributes will create one.  Another one of my tags used the

UrlHelper.buildUrl() method which accesses the valueStack from the 
ActionContext.

So there seems to be some inconsistency in terms of where you get a 
value stack.  Am I missing a concept here or is this worth discussing?  
Thank you.

Fred.

Frederick N. Brier wrote:

> Why would the value stack object change between tags in the same JSP?

> I am calling: ActionContext.getContext().getValueStack() in several 
> tags.  I print out the value each time:
>
> 1st tag: [EMAIL PROTECTED]
> 2nd tag: [EMAIL PROTECTED]
> 3rd tag: [EMAIL PROTECTED]
>
> The tag classes extend the standard TagSupport.   The 3rd tag is the 
> Webwork2 PropertyTag (I stuck a Log INFO statement in it and 
> rebuild).  I have looked at the generated JSP source, but it is not 
> apparent where this could be happening.  Any thoughts as to how this 
> could happen?  Thank you.
>
> Fred.
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?   SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> Opensymphony-webwork mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
>




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to