Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts - Problem replacing arguments with compound messages inresource bundle file

Reply
Thread Tools

Struts - Problem replacing arguments with compound messages inresource bundle file

 
 
John
Guest
Posts: n/a
 
      02-21-2008
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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me install WinXP! Pennywise@DerryMaine.Gov Computer Support 0 05-06-2009 05:27 PM
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me installWinXP! Tony Computer Support 1 05-05-2009 08:47 PM
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me install WinXP! Centre Parting Computer Support 0 05-05-2009 05:58 PM
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me install WinXP! VanguardLH Computer Support 0 05-05-2009 04:52 PM
Re: AMD QUAD CORE Phenom bundle (Maplins bundle) won't let me install WinXP! Buffalo Computer Support 0 05-05-2009 04:16 PM



Advertisments