diff --git a/org.springframework.web/src/main/java/org/springframework/http/MediaType.java b/org.springframework.web/src/main/java/org/springframework/http/MediaType.java index 8b5580dea2e..f9021b4b258 100644 --- a/org.springframework.web/src/main/java/org/springframework/http/MediaType.java +++ b/org.springframework.web/src/main/java/org/springframework/http/MediaType.java @@ -73,7 +73,7 @@ public class MediaType implements Comparable { /** * Create a new {@link MediaType} for the given primary type and subtype. *

The parameters are empty. - * @param typethe primary type + * @param type the primary type * @param subtype the subtype */ public MediaType(String type, String subtype) { diff --git a/org.springframework.web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java b/org.springframework.web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java index e59ac2b2999..ea2955bdbd1 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java +++ b/org.springframework.web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java @@ -18,9 +18,6 @@ package org.springframework.web.client; import java.io.IOException; -import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.client.RestClientException; -import org.springframework.web.client.HttpServerErrorException; import org.springframework.http.HttpStatus; import org.springframework.http.client.ClientHttpResponse; @@ -28,7 +25,8 @@ import org.springframework.http.client.ClientHttpResponse; * Default implementation of the {@link ResponseErrorHandler} interface. * *

This error handler checks for the status code on the {@link ClientHttpResponse}: any code with series - * {@link HttpStatus.Series#CLIENT_ERROR} or {@link HttpStatus.Series#SERVER_ERROR} is considered to be an error. + * {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR} or + * {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR} is considered to be an error. * This behavior can be changed by overriding the {@link #hasError(HttpStatus)} method. * * @author Arjen Poutsma @@ -46,18 +44,24 @@ public class DefaultResponseErrorHandler implements ResponseErrorHandler { /** * Template method called from {@link #hasError(ClientHttpResponse)}. - *

The default implementation checks if the given status code is {@link HttpStatus.Series#CLIENT_ERROR} - * or {@link HttpStatus.Series#SERVER_ERROR}. Can be overridden in subclasses. + *

The default implementation checks if the given status code is + * {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR CLIENT_ERROR} + * or {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR SERVER_ERROR}. Can be overridden in subclasses. * @param statusCode the HTTP status code * @return true if the response has an error; false otherwise - * @see HttpStatus.Series#CLIENT_ERROR - * @see HttpStatus.Series#SERVER_ERROR */ protected boolean hasError(HttpStatus statusCode) { return (statusCode.series() == HttpStatus.Series.CLIENT_ERROR || statusCode.series() == HttpStatus.Series.SERVER_ERROR); } + /** + * {@inheritDoc} + *

The default implementation throws a {@link HttpClientErrorException} if the response status code is + * {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}, a {@link HttpServerErrorException} if it is + * {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR}, and a {@link RestClientException} in other + * cases. + */ public void handleError(ClientHttpResponse response) throws IOException { HttpStatus statusCode = response.getStatusCode(); switch (statusCode.series()) { diff --git a/org.springframework.web/src/main/java/org/springframework/web/client/RestTemplate.java b/org.springframework.web/src/main/java/org/springframework/web/client/RestTemplate.java index 901e61beec1..b1189b54a93 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/client/RestTemplate.java +++ b/org.springframework.web/src/main/java/org/springframework/web/client/RestTemplate.java @@ -45,7 +45,7 @@ import org.springframework.web.util.UriTemplate; * *

The main entry points of this template are the methods named after the five main HTTP methods: * - * + * * * * diff --git a/org.springframework.web/src/main/java/org/springframework/web/client/support/RestGatewaySupport.java b/org.springframework.web/src/main/java/org/springframework/web/client/support/RestGatewaySupport.java index 4ca4e142fcc..4d1a233fcb5 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/client/support/RestGatewaySupport.java +++ b/org.springframework.web/src/main/java/org/springframework/web/client/support/RestGatewaySupport.java @@ -19,9 +19,9 @@ package org.springframework.web.client.support; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.util.Assert; import org.springframework.web.client.RestTemplate; -import org.springframework.http.client.ClientHttpRequestFactory; /** * Convenient super class for application classes that need REST access. @@ -50,7 +50,7 @@ public class RestGatewaySupport { /** * Construct a new instance of the {@link RestGatewaySupport}, with the given {@link ClientHttpRequestFactory}. - * @see RestTemplate#RestTemplate(ClientHttpRequestFactory + * @see RestTemplate#RestTemplate(ClientHttpRequestFactory) */ public RestGatewaySupport(ClientHttpRequestFactory requestFactory) { Assert.notNull(requestFactory, "'requestFactory' must not be null");
HTTP methodRestTemplate methods
HTTP methodRestTemplate methods
DELETE{@link #delete}
GET{@link #getForObject}
HEAD{@link #headForHeaders}