Skip to Main Content
Java Servlet Programming, 2nd Edition
book

Java Servlet Programming, 2nd Edition

by Jason Hunter, William Crawford
April 2001
Intermediate to advanced content levelIntermediate to advanced
780 pages
23h 48m
English
O'Reilly Media, Inc.
Content preview from Java Servlet Programming, 2nd Edition

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Servlet Programming

Java Servlet Programming

Jason Hunter

Publisher Resources

ISBN: 0596000405Supplemental ContentErrata Page