如何从 ActionMessage 中删除特定的错误消息。例如,下面msgKey
是"ABC"
和msg.getKey()
是"ABC"
。现在,当两者相同时,我想从 ActionMessage 中删除密钥。我该怎么做?
Iterator it = warningMessages.get(ActionMessages.GLOBAL_MESSAGE);
while (it.hasNext()) {
ActionMessage msg = (ActionMessage) it.next();
if (msgKey.equalsIgnoreCase(msg.getKey())) {
// remove msgKey from warningMessages
}
}