Hi!
Sorry, I have posted this topic before, but I haven't got an answer, so here's a second try.
I need some help concerning a new feature in Struts 1.2.7.
The ActionMessage class now has a new Constructor.
ActionMessage(java.lang.String key, boolean resource)
Setting the "resource" value to "false" allows you to define a "literal"
Message without having to specify a key in the properties bundle. It will
display exactly the string that is given in the 'key' argument.
In my Action Class, I create two or more ActionMessages:
ActionErrors errors = new ActionErrors();
ActionMessage error1 = new ActionMessage("Literal Error 1", false);
errors.add(ActionMessages.GLOBAL_MESSAGE, error1);
ActionMessage error2 = new ActionMessage("Literal Error 2", false);
errors.add(ActionMessages.GLOBAL_MESSAGE, error2);
saveErrors(request, errors);
In my JSP, I iterate over the ActionMessages in the follwing way:
<table>
<html:messages id="errors">
<tr>
<td>
<bean:write name="errors"/>
</td>
</tr>
</html:messages>
</table>
The poblem now is that in the HTML-Output, only the first Item in the Error
list appears as a literal message, whereas Struts seems to interpret the next message as a resource key:
- Literal Error 1
- ???de.Literal Error 2???
What could be the problem? Any help is appreciated!
Thanks, Ren�