Module org.apache.wicket.request
Class ErrorCodeRequestHandler
java.lang.Object
org.apache.wicket.request.http.handler.ErrorCodeRequestHandler
- All Implemented Interfaces:
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 with
IRequestCycles.- Author:
- Eelco Hillenius
-
Constructor Summary
ConstructorsConstructorDescriptionErrorCodeRequestHandler(int errorCode) Construct.ErrorCodeRequestHandler(int errorCode, String message) Construct. -
Method Summary
Modifier and TypeMethodDescriptionfinal intGets the servlet error code.final StringGets the optional message to send to the client.voidrespond(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, waitMethods inherited from interface org.apache.wicket.request.IRequestHandler
detach
-
Constructor Details
-
ErrorCodeRequestHandler
Construct.- Parameters:
errorCode- the servlet error code; use one of theHttpServletResponseconstants- See Also:
-
HttpServletResponse
-
ErrorCodeRequestHandler
Construct.- Parameters:
errorCode- the servlet error code; use one of theHttpServletResponseconstantsmessage- the optional message to send to the client- See Also:
-
HttpServletResponse
-
-
Method Details
-
respond
Respond by sending the set errorCode and optionally the message to the browser.- Specified by:
respondin interfaceIRequestHandler- Parameters:
requestCycle- the current request cycle- See Also:
-
getErrorCode
Gets the servlet error code.- Returns:
- the servlet error code
-
getMessage
Gets the optional message to send to the client.- Returns:
- the optional message to send to the client
-