home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 November / PCONLINE_11_99.ISO / filesbbs / OS2 / APCHSSL2.ZIP / OS2HTTPD / servlets / NullServlet.java < prev    next >
Encoding:
Java Source  |  1999-02-10  |  1.5 KB  |  52 lines

  1. /*
  2.  * @(#)NullServlet.java    1.4 05/22/97
  3.  * 
  4.  * Copyright (c) 1995-1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.0
  20.  */
  21.  
  22. import java.io.*;
  23.  
  24. import javax.servlet.*;
  25. import javax.servlet.http.*;
  26.  
  27. /**
  28.  *
  29.  * A simple servlet to throw an exception.  Ever wonder what happens
  30.  * if you make a mistake in your code?  Run this to see the error that
  31.  * gets printed.  Also, look in the error log of the webserver, to 
  32.  * see the kind of error that gets printed there.
  33.  *
  34.  * @author Jim Driscoll
  35.  * @version 97/05/22 1.4
  36.  *
  37.  */
  38.  
  39. public class NullServlet extends HttpServlet { 
  40.  
  41.     public void service(HttpServletRequest req, HttpServletResponse res)
  42.     throws ServletException, IOException {
  43.  
  44.         throw new NullPointerException();
  45.  
  46.     }
  47.  
  48.     public String getServletInfo() {
  49.         return "A servlet which demonstrates exception logging";
  50.     }
  51. }
  52.