Package javax.portlet
Class PortletException
java.lang.Object
java.lang.Throwable
java.lang.Exception
javax.portlet.PortletException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
PortletModeException
,PortletSecurityException
,ReadOnlyException
,UnavailableException
,UnmodifiableException
,ValidatorException
,WindowStateException
The
PortletException
class defines a general exception
that a portlet can throw when it is unable to perform its operation
successfully.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new portlet exception.PortletException
(String text) Constructs a new portlet exception with the given text.PortletException
(String text, Throwable cause) Constructs a new portlet exception when the portlet needs to do the following: throw an exception include the "root cause" exception include a description messagePortletException
(Throwable cause) Constructs a new portlet exception when the portlet needs to throw an exception. -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Returns the cause of this throwable ornull
if the cause is nonexistent or unknown.void
Prints the stack trace of this exception to the standard error stream.void
Prints the stack trace of this exception to the specified print stream.void
Prints the stack trace of this exception to the specified print writer.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Field Details
-
cause
-
-
Constructor Details
-
PortletException
public PortletException()Constructs a new portlet exception. -
PortletException
Constructs a new portlet exception with the given text. The portlet container may use the text write it to a log.- Parameters:
text
- the exception text
-
PortletException
Constructs a new portlet exception when the portlet needs to do the following:- throw an exception
- include the "root cause" exception
- include a description message
- Parameters:
text
- the exception textcause
- the root cause
-
PortletException
Constructs a new portlet exception when the portlet needs to throw an exception. The exception's message is based on the localized message of the underlying exception.- Parameters:
cause
- the root cause
-
-
Method Details
-
printStackTrace
public void printStackTrace()Prints the stack trace of this exception to the standard error stream.- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
Prints the stack trace of this exception to the specified print stream.- Overrides:
printStackTrace
in classThrowable
- Parameters:
out
- thePrintStream
to be used for output
-
printStackTrace
Prints the stack trace of this exception to the specified print writer.- Overrides:
printStackTrace
in classThrowable
- Parameters:
out
- thePrintWriter
to be used for output
-
getCause
Returns the cause of this throwable ornull
if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)This implementation returns the cause that was supplied via one of the constructors requiring a Throwable.
-