Struts - Problem replacing arguments with compound messages inresource bundle file

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top