struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <jeromy.ev...@blueskyminds.com.au>
Subject stack fundamentals
Date Sat, 12 Apr 2008 03:41:39 GMT
The i18n tag pushes a TextProvider onto the stack in its opening tag:
getStack().push(tpf.createInstance(bundle, new LocaleProvider() {
                     public Locale getLocale() {
                         return locale;
                     }
                }));

And pops *any object* off the stack in the closing tag:
            getStack().pop();

If a the user pushed another object onto the stack within the tag the 
wrong object is popped off the stack 
(https://issues.apache.org/struts/browse/WW-2539).
At the very least, the i18n tag should log that it popped something 
unexpected from the stack. I'll definitely make that change.

However, fundamentally, does the stack need a method like:
    popUntil(Class aclass), that pops all classes until on an object of 
the specified class is encountered? or
    remove(Class aClass), that removes an object from within the stack (yuk)

I think both are bad ideas.  So should the i18n tag pop off everything 
until it encounters a TextProvider (still pops unexpecterd objects), or 
is the i18n tag making an invalid use of the stack?  I think its use of 
the stack is valid as it needs to push a TextProvider in front of the 
action, but stack manipulation is permitted within the tag.

Any better thoughts on this issue?      

cheers,
 Jeromy Evans

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message