我正在为我的休息服务使用 Google 云端点。我正在使用 RestyGWT 在 GWT Web 客户端中使用这些数据。
我注意到,当我尝试将 JSON 转换为 POJO 时,云端点会自动将长数据类型括在双引号中,这导致 RestyGWT 中出现异常。
这是我的示例代码。
@Api(name = "test")
public class EndpointAPI {
@ApiMethod(httpMethod = HttpMethod.GET, path = "test")
public Container test() {
Container container = new Container();
container.testLong = (long)3234345;
container.testDate = new Date();
container.testString = "sathya";
container.testDouble = 123.98;
container.testInt = 123;
return container;
}
public class Container {
public long testLong;
public Date testDate;
public String testString;
public double testDouble;
public int testInt;
}
Run Code Online (Sandbox Code Playgroud)
}
这是云端点以 JSON …
我需要开发一个需要桌面,移动设备,平板电脑支持的gwt应用程序.我需要选择是使用m-gwt还是坚持使用Google IO 2011中提供的方法
Google IO 2011方法似乎是 -
1)为不同的屏幕尺寸创建不同的视图
2)使用延迟绑定仅根据用户代理加载相关视图3)相同的演示者代码
IO 2011的方法对我来说似乎更简单(并没有与活动和地方联系在一起),但我不确定这种方法是否仍然流行且有效.
有人可以让我知道这两种方法的优缺点吗?
此致,
沙迪亚
我正在运行一个https Web服务器。我正在使用可对Web服务器进行Ajax调用的有角度的Web应用程序(Chrome浏览器)对其进行测试。
如果我持续不断地访问Web服务器,那么一切似乎都可以正常工作。但是,每当我将其闲置一段时间并访问Web服务器时,来自浏览器的ajax调用都不会得到响应。几乎总是在服务器日志中看到此日志行。
2016/01/16 04:06:47.006977 http: TLS handshake error from 42.21.139.47:51463: EOF
我可以确认IP地址是我的IP地址。
我正在这样启动我的https服务器:
r := mux.NewRouter()
r.HandleFunc("/status", handleStatus)
setUpLoginEndpoint(&cfg.Session, r)
setUpLogoutEndpoint(cfg.Session.CookieName, r)
setUpChangePasswordEndpoint(cfg.Session.CookieName, r)
setUpMetricSinkEndpoint(cfg.Metric.SinkApiKey, r)
setUpMetricQueryEndpoint(cfg.Session.CookieName, r)
http.ListenAndServeTLS(":443", "../cert.pem", "../keys.pem", &Server{r})
Run Code Online (Sandbox Code Playgroud)
我可以确认是否使用defer r.Body.Close()关闭每个处理程序中的请求主体。
我正在使用1.5.2。
任何帮助,将不胜感激。
问候,
萨提亚