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
IRequestCycle
s.- Author:
- Eelco Hillenius
-
Constructor Summary
ConstructorsConstructorDescriptionErrorCodeRequestHandler
(int errorCode) Construct.ErrorCodeRequestHandler
(int errorCode, String message) Construct. -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Gets the servlet error code.final String
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 Details
-
ErrorCodeRequestHandler
Construct.- Parameters:
errorCode
- the servlet error code; use one of theHttpServletResponse
constants- See Also:
-
HttpServletResponse
-
ErrorCodeRequestHandler
Construct.- Parameters:
errorCode
- the servlet error code; use one of theHttpServletResponse
constantsmessage
- 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:
respond
in 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
-