Created
January 12, 2012 21:07
-
-
Save ms-tg/1603111 to your computer and use it in GitHub Desktop.
./TIMWeb/src/main/java/gwt/example01firstlight/server/Example01FirstLightServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gwt.example01firstlight.server; | |
import com.google.gwt.user.server.rpc.RemoteServiceServlet; | |
import com.google.inject.Singleton; | |
import gwt.example01firstlight.client.Example01FirstLightService; | |
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
@Singleton | |
public class Example01FirstLightServiceImpl extends RemoteServiceServlet implements Example01FirstLightService { | |
@Override | |
public String getMessage(String name) { | |
String hostName = null; | |
try { | |
hostName = InetAddress.getLocalHost().getHostName(); | |
} catch (UnknownHostException ignored) { | |
hostName = "<could not retrieve hostname from server>"; | |
} | |
return "Hello, " + name + ", from " + hostName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment