org.apache.wicket.protocol.http.request
Class WebErrorCodeResponseTarget

java.lang.Object
  extended by org.apache.wicket.protocol.http.request.WebErrorCodeResponseTarget
All Implemented Interfaces:
IRequestTarget

public final class WebErrorCodeResponseTarget
extends java.lang.Object
implements IRequestTarget

Response target that is to be used in a servlet environment to send an error code and optionally a message. NOTE: this target can only be used in a servlet environment with WebRequestCycles.

Author:
Eelco Hillenius

Constructor Summary
WebErrorCodeResponseTarget(int errorCode)
          Construct.
WebErrorCodeResponseTarget(int errorCode, java.lang.String message)
          Construct.
 
Method Summary
 void detach(RequestCycle requestCycle)
          This method is called at the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.
 boolean equals(java.lang.Object obj)
           
 int getErrorCode()
          Gets the servlet error code.
 java.lang.String getMessage()
          Gets the optional message to send to the client.
 int hashCode()
           
 void respond(RequestCycle requestCycle)
          Respond by sending the set errorCode and optionally the message to the browser.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebErrorCodeResponseTarget

public WebErrorCodeResponseTarget(int errorCode)
Construct.

Parameters:
errorCode - the servlet error code; use one of the HttpServletResponse constants
See Also:
HttpServletResponse

WebErrorCodeResponseTarget

public WebErrorCodeResponseTarget(int errorCode,
                                  java.lang.String message)
Construct.

Parameters:
errorCode - the servlet error code; use one of the HttpServletResponse constants
message - the optional message to send to the client
See Also:
HttpServletResponse
Method Detail

respond

public void respond(RequestCycle requestCycle)
Respond by sending the set errorCode and optionally the message to the browser.

Specified by:
respond in interface IRequestTarget
Parameters:
requestCycle - the current request cycle
See Also:
IRequestTarget.respond(org.apache.wicket.RequestCycle)

getErrorCode

public final int getErrorCode()
Gets the servlet error code.

Returns:
the servlet error code

getMessage

public final java.lang.String getMessage()
Gets the optional message to send to the client.

Returns:
the optional message to send to the client

detach

public void detach(RequestCycle requestCycle)
Description copied from interface: IRequestTarget
This method is called at the end of a request cycle to indicate that processing is done and that cleaning up of the subject(s) of this target may be done.

Specified by:
detach in interface IRequestTarget
Parameters:
requestCycle - the current request cycle
See Also:
IRequestTarget.detach(org.apache.wicket.RequestCycle)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.