If in my properties page, i have a line like
msg.publisher.rp.publish.success=The research paper {0} has been successfully published
then how do i display the {0} to the value i want on my page? Anyone knows?
Thank you!
Printable View
If in my properties page, i have a line like
msg.publisher.rp.publish.success=The research paper {0} has been successfully published
then how do i display the {0} to the value i want on my page? Anyone knows?
Thank you!
I understand here you use the struts.properties as just a properties file
You can read it as below.
http://www.java-forums.org/new-java/...ties-file.html
Or in the Struts
thenCode:import org.apache.struts.util.MessageResources;
...
private MessageResources messages = MessageResources.getMessageResources("struts.properties");
String message = messages.getMessage("my.message");
message.replaceAll the {0} withe the value.
Did I answer the question ?
here is how I use it, but I am not using struts 2. Not sure what version you are using.
Code:ActionMessages message = new ActionMessages();
message.add("msg.publisher.rp.publish.success", new ActionMessage("msg.publisher.rp.publish.success", "Success"));
ok.. i'm using struts 1.3.. thanks for the answers.. :)