Uses resource message key instead of passing message directly

This commit is contained in:
Lukasz Lenart
2017-06-23 09:22:43 +02:00
parent 9e8627ca66
commit 73da12e723
4 changed files with 7 additions and 1 deletions
@@ -36,7 +36,8 @@ public class SaveGangsterAction extends Action {
// Some code to save the gangster to the db as necessary
GangsterForm gform = (GangsterForm) form;
ActionMessages messages = new ActionMessages();
messages.add("msg", new ActionMessage("Gangster " + gform.getName() + " added successfully"));
System.out.println(gform.getName());
messages.add("msg", new ActionMessage("struts1.gangsterAdded", gform.getName()));
addMessages(request, messages);
return mapping.findForward("success");
@@ -7,3 +7,5 @@ item.create=Create {0}
item.list={0} List
token.transfer.time=The bank transfer was executed at {0,date,HH:mm:ss MM-dd-yyyy}
struts1.gangsterAdded=Gangster {0} added successfully
@@ -5,3 +5,5 @@ item.create={0} neu anlegen
item.list={0}-Liste
token.transfer.time=Die \u00dcberweisung wurde am {0,date,HH:mm:ss MM-dd-yyyy} durchgef\u00fchrt
struts1.gangsterAdded=Gangster {0} wurde erfolgreich hinzugefugt
@@ -0,0 +1 @@
struts1.gangsterAdded=Gangster {0} anadido con exito