RESTEASY-2292 JAX-RS client should support redirect / Jersey分析(一)
参考并分析jersey里面的redirect实现。
- rest - Jersey jax.rs client 2.5 follow redirect from HTTP to HTTPS
- rest - Jersey client doesn’t follow redirects - Stack Overflow
- java - HTTPURLConnection Doesn’t Follow Redirect from HTTP to HTTPS
RedirectTest是分服务器测试的
$ find . | grep FollowRedirectsTest
./connectors/grizzly-connector/src/test/java/org/glassfish/jersey/grizzly/connector/FollowRedirectsTest.java
./connectors/apache-connector/src/test/java/org/glassfish/jersey/apache/connector/FollowRedirectsTest.java
./connectors/jetty-connector/src/test/java/org/glassfish/jersey/jetty/connector/FollowRedirectsTest.java
./tests/e2e-client/src/test/java/org/glassfish/jersey/tests/e2e/client/FollowRedirectsTest.java
./test-framework/providers/inmemory/src/test/java/org/glassfish/jersey/test/inmemory/internal/FollowRedirectsTest.java
$
$ find . | grep ClientProperties
./connectors/apache-connector/target/classes/org/glassfish/jersey/apache/connector/ApacheClientProperties.class
./connectors/apache-connector/src/main/java/org/glassfish/jersey/apache/connector/ApacheClientProperties.java
./connectors/jetty-connector/target/classes/org/glassfish/jersey/jetty/connector/JettyClientProperties.class
./connectors/jetty-connector/src/main/java/org/glassfish/jersey/jetty/connector/JettyClientProperties.java
./core-client/target/classes/org/glassfish/jersey/client/ClientProperties.class
./core-client/src/main/java/org/glassfish/jersey/client/ClientProperties.java
./bundles/jaxrs-ri/target/classes/org/glassfish/jersey/client/ClientProperties.class
./bundles/jaxrs-ri/target/unpacked-src/main/java/org/glassfish/jersey/client/ClientProperties.java
$
InMemoryTestContainer
Container
的构建过程: