You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2017/06/23 07:22:58 UTC

struts git commit: Uses resource message key instead of passing message directly

Repository: struts
Updated Branches:
  refs/heads/support-2-3 9e8627ca6 -> 73da12e72


Uses resource message key instead of passing message directly


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/73da12e7
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/73da12e7
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/73da12e7

Branch: refs/heads/support-2-3
Commit: 73da12e723c2737bd515946588ddcd898acf584a
Parents: 9e8627c
Author: Lukasz Lenart <lu...@apache.org>
Authored: Fri Jun 23 09:22:43 2017 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Fri Jun 23 09:22:43 2017 +0200

----------------------------------------------------------------------
 .../apache/struts2/showcase/integration/SaveGangsterAction.java   | 3 ++-
 apps/showcase/src/main/resources/globalMessages.properties        | 2 ++
 apps/showcase/src/main/resources/globalMessages_de.properties     | 2 ++
 apps/showcase/src/main/resources/globalMessages_en.properties     | 1 +
 4 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/73da12e7/apps/showcase/src/main/java/org/apache/struts2/showcase/integration/SaveGangsterAction.java
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/java/org/apache/struts2/showcase/integration/SaveGangsterAction.java b/apps/showcase/src/main/java/org/apache/struts2/showcase/integration/SaveGangsterAction.java
index afc3587..830e377 100644
--- a/apps/showcase/src/main/java/org/apache/struts2/showcase/integration/SaveGangsterAction.java
+++ b/apps/showcase/src/main/java/org/apache/struts2/showcase/integration/SaveGangsterAction.java
@@ -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");

http://git-wip-us.apache.org/repos/asf/struts/blob/73da12e7/apps/showcase/src/main/resources/globalMessages.properties
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/resources/globalMessages.properties b/apps/showcase/src/main/resources/globalMessages.properties
index d3417f7..4e61a5d 100644
--- a/apps/showcase/src/main/resources/globalMessages.properties
+++ b/apps/showcase/src/main/resources/globalMessages.properties
@@ -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
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts/blob/73da12e7/apps/showcase/src/main/resources/globalMessages_de.properties
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/resources/globalMessages_de.properties b/apps/showcase/src/main/resources/globalMessages_de.properties
index 0dc66ef..1eb8c36 100644
--- a/apps/showcase/src/main/resources/globalMessages_de.properties
+++ b/apps/showcase/src/main/resources/globalMessages_de.properties
@@ -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

http://git-wip-us.apache.org/repos/asf/struts/blob/73da12e7/apps/showcase/src/main/resources/globalMessages_en.properties
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/resources/globalMessages_en.properties b/apps/showcase/src/main/resources/globalMessages_en.properties
index e69de29..cb189e1 100644
--- a/apps/showcase/src/main/resources/globalMessages_en.properties
+++ b/apps/showcase/src/main/resources/globalMessages_en.properties
@@ -0,0 +1 @@
+struts1.gangsterAdded=Gangster {0} anadido con exito
\ No newline at end of file