Class ErrorCodeRequestHandler
- java.lang.Object
-
- org.apache.wicket.request.http.handler.ErrorCodeRequestHandler
-
- All Implemented Interfaces:
IRequestHandler
public final class ErrorCodeRequestHandler extends Object implements IRequestHandler
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 withIRequestCycle
s.- Author:
- Eelco Hillenius
-
-
Constructor Summary
Constructors Constructor Description ErrorCodeRequestHandler(int errorCode)
Construct.ErrorCodeRequestHandler(int errorCode, String message)
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getErrorCode()
Gets the servlet error code.String
getMessage()
Gets the optional message to send to the client.void
respond(IRequestCycle requestCycle)
Respond by sending the set errorCode and optionally the message to the browser.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.request.IRequestHandler
detach
-
-
-
-
Constructor Detail
-
ErrorCodeRequestHandler
public ErrorCodeRequestHandler(int errorCode)
Construct.- Parameters:
errorCode
- the servlet error code; use one of theHttpServletResponse
constants- See Also:
HttpServletResponse
-
ErrorCodeRequestHandler
public ErrorCodeRequestHandler(int errorCode, String message)
Construct.- Parameters:
errorCode
- the servlet error code; use one of theHttpServletResponse
constantsmessage
- the optional message to send to the client- See Also:
HttpServletResponse
-
-
Method Detail
-
respond
public void respond(IRequestCycle requestCycle)
Respond by sending the set errorCode and optionally the message to the browser.- Specified by:
respond
in interfaceIRequestHandler
- Parameters:
requestCycle
- the current request cycle- See Also:
IRequestHandler.respond(org.apache.wicket.request.IRequestCycle)
-
getErrorCode
public final int getErrorCode()
Gets the servlet error code.- Returns:
- the servlet error code
-
getMessage
public final String getMessage()
Gets the optional message to send to the client.- Returns:
- the optional message to send to the client
-
-