summaryrefslogtreecommitdiff
path: root/java/demo/IceGrid/icebox/HelloI.java
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2012-10-08 22:16:01 +0200
committerJose <jose@zeroc.com>2012-10-08 22:16:01 +0200
commita622e1cbab7ff128f11e9557967ac0f8e70befbd (patch)
treed26079e8255d373ebca5006844efee7377049ac1 /java/demo/IceGrid/icebox/HelloI.java
parentremoved first "dummy" parameter for getIn in Ice/custom/AllTests.cpp (diff)
downloadice-a622e1cbab7ff128f11e9557967ac0f8e70befbd.tar.bz2
ice-a622e1cbab7ff128f11e9557967ac0f8e70befbd.tar.xz
ice-a622e1cbab7ff128f11e9557967ac0f8e70befbd.zip
Fixed ICE-4561 - IceGrid demo with <env>
Diffstat (limited to 'java/demo/IceGrid/icebox/HelloI.java')
-rw-r--r--java/demo/IceGrid/icebox/HelloI.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/java/demo/IceGrid/icebox/HelloI.java b/java/demo/IceGrid/icebox/HelloI.java
index 420638660b8..05395ff5f12 100644
--- a/java/demo/IceGrid/icebox/HelloI.java
+++ b/java/demo/IceGrid/icebox/HelloI.java
@@ -19,7 +19,26 @@ public class HelloI extends _HelloDisp
public void
sayHello(Ice.Current current)
{
- System.out.println("Hello from " + _serviceName);
+ java.util.Map<String,String> env = System.getenv();
+ String lang = env.containsKey("LANG") ? env.get("LANG") : "en";
+ String greeting = "Hello, ";
+ if(lang.equals("fr"))
+ {
+ greeting = "Bonjour, ";
+ }
+ else if(lang.equals("de"))
+ {
+ greeting = "Hallo, ";
+ }
+ else if(lang.equals("es"))
+ {
+ greeting = "Hola, ";
+ }
+ else if(lang.equals("it"))
+ {
+ greeting = "Ciao, ";
+ }
+ System.out.println(greeting + _serviceName);
}
private String _serviceName;