In this situation: <i18n:message key="exist">text</i18n:message> <i18n:message key="doesn't exist"/> then the second tag shows the content of the first one. This is because in the first step, a body is assigned but not used (so not .clear() ), and in the second step no body is assigned, but needed and one already exists.
To fix this bug, - Add this method in MessageTag.java /** * If key is not found, use the body content as a default value. */ public int doAfterBody() throws JspException { // if the value is null, use the body content if ( _value == null ) { _value = bodyContent.getString(); } // cleanup bodyContent.clearBody(); return SKIP_BODY; } - Remove this part from doEndTag() in MessageTag.java // if the value is null, use the body content if ( _value == null ) { _value = bodyContent.getString(); bodyContent.clear(); }
Please supply patches created using 'cvs diff -u'. That makes it much simpler for us to apply them. Thanks.
Created attachment 11729 [details] MessageTag patch
Applied changes to CVS, thanks for the patch.
*** Bug 18523 has been marked as a duplicate of this bug. ***