J
John
Hi everybody,
I have a Struts Web Application and I have a problem with replacing
the arguments in compound messages:
I have an entry in my ApplicationResources.properties:
message.intranet.zero-result=Sorry that your search did not return any
results. {0}
My JSP contains the following:
<bean:message key="message.intranet.zero-result"/>
and in my action I want to substitute the {0}-argument:
ActionMessages messages = new ActionMessages();
......
String[] moreMessages = new String[1];
moreMessages[0] = "Hello";
ActionMessage aMessage = new ActionMessage(msg, moreMessages);
messages.add(ActionMessages.GLOBAL_MESSAGE, aMessage);
saveMessages(request, messages);
At runtime, the JSP compiles as follows:
"Sorry that your search did not return any results. null"
The value of the key is retrieved correctly from the properties-file;
but, instead of the String "Hello" at {0}, the argument is null.
What am I doing wrong?
Thank you very much for your help,
John
I have a Struts Web Application and I have a problem with replacing
the arguments in compound messages:
I have an entry in my ApplicationResources.properties:
message.intranet.zero-result=Sorry that your search did not return any
results. {0}
My JSP contains the following:
<bean:message key="message.intranet.zero-result"/>
and in my action I want to substitute the {0}-argument:
ActionMessages messages = new ActionMessages();
......
String[] moreMessages = new String[1];
moreMessages[0] = "Hello";
ActionMessage aMessage = new ActionMessage(msg, moreMessages);
messages.add(ActionMessages.GLOBAL_MESSAGE, aMessage);
saveMessages(request, messages);
At runtime, the JSP compiles as follows:
"Sorry that your search did not return any results. null"
The value of the key is retrieved correctly from the properties-file;
but, instead of the String "Hello" at {0}, the argument is null.
What am I doing wrong?
Thank you very much for your help,
John