@Response(code=302, description="Found") @BeanIgnore public class Found extends HttpResponse
Tells the client to look at (browse to) another url. 302 has been superseded by 303 and 307. This is an example of industry practice contradicting the standard. The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302 with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours. However, some Web applications and frameworks use the 302 status code as if it were the 303.
Modifier and Type | Field and Description |
---|---|
static int |
CODE
HTTP status code
|
static Found |
INSTANCE
Reusable instance.
|
static String |
MESSAGE
Default message
|
Constructor and Description |
---|
Found()
Constructor using HTTP-standard message.
|
Found(String message)
Constructor with no redirect.
|
Found(String message,
URI location)
Constructor using custom message.
|
Found(URI location)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
URI |
getLocation() |
toString
public static final int CODE
public static final String MESSAGE
public Found()
public Found(String message)
Used for end-to-end interfaces.
message
- Message to send as the response.public Found(String message, URI location)
message
- Message to send as the response.location
- @ResponseHeader(name="Location", description="Location of resource.") public URI getLocation()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.