This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes setting parameters for message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "setting parameters for message" Watch "setting parameters for message" New topic
Author

setting parameters for message

lynn fann
Ranch Hand

Joined: Oct 15, 2006
Posts: 115
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.
Jim Hardin
Ranch Hand

Joined: Aug 02, 2006
Posts: 46
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

Joined: Oct 15, 2006
Posts: 115
i try
String limit="7";
ActionMessage actionMsg= new ActionMessage("msg.notice",limit);

but i still get a null for the {0}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setting parameters for message
 
Similar Threads
ActionMessage and showing message to jsp
Custom Validations in Struts Validator Framework?
Checking for an ActionMessage in the JSP
Struts Errors
Errors populated in ActionMessages is not displaying