Name

UnavailableException

Synopsis

Class Name: javax.servlet.UnavailableException

Superclass: javax.servlet.ServletException

Immediate Subclasses: None

Interfaces Implemented: None

Availability: Servlet API 1.0 and later

Description

A servlet can throw an UnavailableException at any time to indicate that it is not available to service client requests. There are two types of unavailability: permanent (where the problem will not correct itself and administrative action needs to be taken) and temporary (where the problem will likely correct itself after some length of time). To mark a servlet as temporarily unavailable, specify a duration (in seconds) when constructing the exception. Well-written servlet containers will use the duration to provide better error messages to the client. Servlet implementations are allowed to treat temporary unavailability as permanent unavailability.

Class Summary

public class UnavailableException extends ServletException {
  // Constructors
  public UnavailableException(int seconds, Servlet servlet, String msg);  // Deprecated
  public UnavailableException(Servlet servlet, String msg);  // Deprecated  
  public UnavailableException(String msg);                   // New in 2.2
  public UnavailableException(String msg, int seconds);      // New in 2.2

  // Instance methods
  public Servlet getServlet();                               // Deprecated
  public int getUnavailableSeconds();
  public boolean isPermanent();
}

Constructors

UnavailableException()

public UnavailableException(String msg) public UnavailableException(String msg, int ...

Get Java Servlet Programming, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.