ServletContext context = request.getSession().getServletContext();
// substitute $$sgs.server with the sgs server URL
String serverURL = ServletPropertyUtil.getProperty("jnlp.wonderland.server.url", context);
if (serverURL == null) {
UriBuilder builder = UriBuilder.fromUri(request.getRequestURL().toString());
serverURL = builder.replacePath("/").build().toString();
/*try {
serverName = InetAddress.getLocalHost().getCanonicalHostName();
} catch (UnknownHostException uhe) {
logger.log(Level.WARNING, "Error getting local host", uhe);
serverName = "localhost";
}*/
}
jnlpTemplate = substitute(jnlpTemplate, "$$wonderland.server.url", serverURL);
// substitute in the config directory
String configDirURL = ServletPropertyUtil.getProperty("jnlp.wonderland.client.config.dir", context);
if (configDirURL == null) {
UriBuilder builder = UriBuilder.fromUri(request.getRequestURL().toString());
configDirURL = builder.replacePath("/wonderland-web-front/config/").build().toString();
}
jnlpTemplate = substitute(jnlpTemplate, "$$wonderland.client.config.dir", configDirURL);
// add in additional properties
StringBuilder props = new StringBuilder();