• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting parameters for message

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what should i do, so that i can set the parameter to the message string. i try the following, but i get "null" for the {0}.


codes:


resource bundle:


thanks.
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lynn,
It looks to me like you may have a typo -- you have


String limit="7";
ActionMessage actionMsg= new ActionMessage("notice","msg.notice",limit);


where I think you want


String limit="7";
ActionMessage actionMsg= new ActionMessage("msg.notice",limit);


The first argument/actual-parameter to all ActionMessage constructors is the key into the Resource Bundle. Looks like a simple typo...
-Jim
 
lynn fann
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i try
String limit="7";
ActionMessage actionMsg= new ActionMessage("msg.notice",limit);

but i still get a null for the {0}
reply
    Bookmark Topic Watch Topic
  • New Topic