ccs.http
Class RedirectException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by ccs.http.HException
                  extended by 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

Constructor Summary
RedirectException(java.lang.String target)
          Generates a redirect.
 
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 ccs.http.HException
getCode, getCodeString, getLocalizedMessage, send, sendln, toString
 
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
 

Constructor Detail

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.
Method Detail

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