ccs.http
Class RedirectException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
ccs.http.HException
ccs.http.RedirectException
- All Implemented Interfaces:
- java.io.Serializable
public class RedirectException
- extends HException
An exception which causes the HTTPAdaptor to send a redirect message
back to the browser.
- See Also:
- Serialized Form
Method Summary |
SwappingBuffer |
defaultBody(java.lang.String method,
java.lang.String uri)
Builds a default HTML message body which describes this exception. |
java.lang.String |
getTarget()
Returns the target URL this redirect points to. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RedirectException
public RedirectException(java.lang.String target)
- Generates a redirect.
- Parameters:
target
- Tell the browser where to go. This is a literal.
NB. Don't assume you're the primary application unless you really need to -
if your target is an absolute path, consider the ctor with two parameters
instead.
getTarget
public java.lang.String getTarget()
- Returns the target URL this redirect points to.
defaultBody
public SwappingBuffer defaultBody(java.lang.String method,
java.lang.String uri)
throws java.io.IOException
- Builds a default HTML message body which describes this exception. This is
functional but plain, and serves as a fallback if more advanced
"pretty-print" mechanisms are not available.
- Overrides:
defaultBody
in class HException
- Parameters:
method
- The HTTP method in force at the time.uri
- The URI being requested.
- Throws:
java.io.IOException