如何将字符串对象 myString 传递给 Java Play Framework 2.1 版中的内部函数,以便它在内部函数中可用?
这就是我想要做的:
String myString = "Test";
Promise<Response> promise = WS.url("http://www.google.com").get();
promise.map(new Function() {
public void apply(Response r) {
// Does not compile, because "myString" is not available inside inner function
Logger.info("Content of String: " + myString);
}
});
非常感谢你的帮助!