Browse Source

Granting Keith's wish

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3635 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Arjen Poutsma 16 years ago
parent
commit
aeeb0cea73
  1. 2
      org.springframework.web/src/main/java/org/springframework/http/HttpEntity.java
  2. 12
      org.springframework.web/src/main/java/org/springframework/http/ResponseEntity.java

2
org.springframework.web/src/main/java/org/springframework/http/HttpEntity.java

@ -66,7 +66,7 @@ public class HttpEntity<T> {
/** /**
* Create a new, empty {@code HttpEntity}. * Create a new, empty {@code HttpEntity}.
*/ */
private HttpEntity() { protected HttpEntity() {
this(null, null); this(null, null);
} }

12
org.springframework.web/src/main/java/org/springframework/http/ResponseEntity.java

@ -28,8 +28,7 @@ import org.springframework.util.MultiValueMap;
* MediaType contentType = entity.getHeaders().getContentType(); * MediaType contentType = entity.getHeaders().getContentType();
* HttpStatus statusCode = entity.getStatusCode(); * HttpStatus statusCode = entity.getStatusCode();
* </pre> * </pre>
* Can also be used in Spring MVC, as a return value from a @Controller method: * <p>Can also be used in Spring MVC, as a return value from a @Controller method:
* <p>Can be used in Spring MVC, as a return value from a @Controller method:
* <pre class="code"> * <pre class="code">
* &#64;RequestMapping("/handle") * &#64;RequestMapping("/handle")
* public ResponseEntity&lt;String&gt; handle() { * public ResponseEntity&lt;String&gt; handle() {
@ -47,6 +46,15 @@ public class ResponseEntity<T> extends HttpEntity<T> {
private final HttpStatus statusCode; private final HttpStatus statusCode;
/**
* Create a new {@code ResponseEntity} with the given status code, and no body nor headers.
* @param statusCode the status code
*/
public ResponseEntity(HttpStatus statusCode) {
super();
this.statusCode = statusCode;
}
/** /**
* Create a new {@code ResponseEntity} with the given body and status code, and no headers. * Create a new {@code ResponseEntity} with the given body and status code, and no headers.
* @param body the entity body * @param body the entity body

Loading…
Cancel
Save