Skip to content

Instantly share code, notes, and snippets.

@ms-tg
Created January 12, 2012 21:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ms-tg/1603111 to your computer and use it in GitHub Desktop.
Save ms-tg/1603111 to your computer and use it in GitHub Desktop.
./TIMWeb/src/main/java/gwt/example01firstlight/server/Example01FirstLightServiceImpl.java
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