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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to