我在从HttpRequest JavaDoc编译简单的阻塞GET示例时遇到问题:
package org.example;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import static java.net.http.HttpRequest.noBody;
import static java.net.http.HttpResponse.asString;
public class Http2 {
public static void main(String[] args) throws URISyntaxException, IOException, InterruptedException {
HttpResponse response = HttpRequest
.create(new URI("http://www.infoq.com"))
.body(noBody())
.GET().response();
int responseCode = response.statusCode();
String responseBody = response.body(asString());
System.out.println(responseBody);
}
}
Run Code Online (Sandbox Code Playgroud)
package java.net.http does not exist使用JDK 9进行编译时遇到错误:
{ jdk9 } » /cygdrive/c/Program\ Files/Java/jdk-9/bin/javac -d out/production -modulesourcepath org.example.module1/src/ -m org.example.module1
org.example.module1\src\org.example.module1\org\example\Http2.java:6: error: package java.net.http does not exist
import … CI(本机)是否可以从两个不同的控制器登录到两个不同的文件?我没有在用户手册中找到此选项,也没有在Google中找到任何解决方案.
是否有可用于CI的第三方日志库?
如何读取方面中的注释属性值?
我希望对所有使用@Transactional注释的关节点执行我的Around建议(readonly = false).
@Around("execution(* com.mycompany.services.*.*(..)) "
+ "&& @annotation(org.springframework.transaction.annotation.Transactional)")
public Object myMethod(ProceedingJoinPoint pjp) throws Throwable {
}
Run Code Online (Sandbox Code Playgroud)