christophedelory.servlet
Class HttpServletException
java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.servlet.ServletException
christophedelory.servlet.HttpServletException
- All Implemented Interfaces:
- Serializable
public class HttpServletException
- extends ServletException
Defines a general exception an HTTP servlet can throw when it encounters difficulty.
- Version:
- $Revision: 106 $
- Author:
- Christophe Delory
- See Also:
- Serialized Form
Constructor Summary |
HttpServletException(int sc,
String message)
Constructs a new HTTP servlet exception with the specified message. |
HttpServletException(int sc,
Throwable rootCause)
Constructs a new HTTP servlet exception when the servlet needs to throw an exception
and include a message about the "root cause" exception that interfered with its normal operation. |
Method Summary |
int |
getStatusCode()
Returns the error status code. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
HttpServletException
public HttpServletException(int sc,
String message)
- Constructs a new HTTP servlet exception with the specified message.
The message can be written to the server log and/or displayed for the user.
- Parameters:
sc
- the error status code.message
- a string specifying the text of the exception message.- See Also:
ServletException.ServletException(String)
,
HttpServletResponse.sendError(int)
,
HttpServletResponse.sendError(int,String)
HttpServletException
public HttpServletException(int sc,
Throwable rootCause)
- Constructs a new HTTP servlet exception when the servlet needs to throw an exception
and include a message about the "root cause" exception that interfered with its normal operation.
The exception's message is based on the localized message of the underlying exception.
This method calls the
Throwable.getLocalizedMessage()
method to get a localized exception message.
- Parameters:
sc
- the error status code.rootCause
- the exception that interfered with the servlet's normal operation, making this servlet exception necessary.- See Also:
ServletException.ServletException(Throwable)
,
HttpServletResponse.sendError(int)
,
HttpServletResponse.sendError(int,String)
getStatusCode
public int getStatusCode()
- Returns the error status code.
- Returns:
- a status code.
- See Also:
HttpServletResponse.sendError(int)
Copyright © 2008-2009 Christophe Delory. All Rights Reserved.