提交 2e8987be authored 作者: Thomas Mueller's avatar Thomas Mueller

Improved support for GAE for Java thanks to Vince Bonfanti

上级 bfc58c58
差异被折叠。
......@@ -289,7 +289,11 @@ public class WebServer implements Service {
}
private void updateURL() {
url = (ssl ? "https" : "http") + "://" + NetUtils.getLocalAddress() + ":" + port;
try {
url = (ssl ? "https" : "http") + "://" + NetUtils.getLocalAddress() + ":" + port;
} catch (NoClassDefFoundError e) {
// Google App Engine does not allow java.net.InetAddress
}
}
public void start() throws SQLException {
......
......@@ -64,6 +64,9 @@ public class WebServlet extends HttpServlet {
return address.isLoopbackAddress();
} catch (UnknownHostException e) {
return false;
} catch (NoClassDefFoundError e) {
// Google App Engine does not allow java.net.InetAddress
return false;
}
}
......@@ -106,7 +109,7 @@ public class WebServlet extends HttpServlet {
if (sessionId != null) {
session = server.getSession(sessionId);
}
WebThread app = new WebThread(null, server);
WebApp app = new WebApp(server);
app.setSession(session, attributes);
String ifModifiedSince = req.getHeader("if-modified-since");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论