You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2005/09/26 22:28:29 UTC
DO NOT REPLY [Bug 36820] New: -
doAfterBody() in MessagesTag: can not handle last bundled msg
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36820>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=36820
Summary: doAfterBody() in MessagesTag: can not handle last
bundled msg
Product: Struts
Version: 1.2.7
Platform: Other
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Struts-Faces Library
AssignedTo: dev@struts.apache.org
ReportedBy: yuli.gao@fmr.com
If the last validation error message is a bundled message and if the following
tags are used in jsps to display the error messages:
<logic:messagesPresent>
<bean:message key="errors.header"/>
<ul>
<html:messages id="error">
<li><bean:write name="error"/></li>
</html:messages>
</ul><hr />
</logic:messagesPresent>
then the last error message could not be retrieved correctly.
Tee bug is in method doAfterBody() in
org.apache.struts.taglib.html.MessagesTag - message loading in the method does
not concern if the message is bundled, as what did in method doStartTag().
After changed the code in the method the message can be displayed correctly.
Here is the code before and after the change:
Before the change:
ActionMessage report = (ActionMessage) iterator.next();
String msg =
TagUtils.getInstance().message(
pageContext,
bundle,
locale,
report.getKey(),
report.getValues());
After the change:
ActionMessage report = (ActionMessage) iterator.next();
String msg;
if (report.isResource()) {
msg = TagUtils.getInstance().message(
pageContext,
bundle,
locale,
report.getKey(),
report.getValues());
} else {
msg = report.getKey();
}
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org