code: public static void dumpServletContext( ServletContext context, PrintStream output )
      {
          if ( output == null )
          {
              output = System.err;
          }
  
          output.println( "*** ServletContext " + context );
  
          for ( Enumeration e = context.getAttributeNames(); e.hasMoreElements(); )
          {
              String name = ( String ) e.nextElement();
              output.println( "            attribute " + name + " = " + context.getAttribute( name ) );
          }
      }
docs: Print attributes in the given ServletContext.
  
  @param context the current ServletContext.
  @param output a PrintStream to which to output ServletContext attributes; if <code>null</null>,
  <code>System.err</code> is used.