table.addElement( new TR()
.addElement( new TH( "Key" ) )
.addElement( new TH( "String Value" ) ) );
table.addElement( new TR()
.addElement( new TD( "Server Info" ) )
.addElement( new TD( context.getServerInfo() ) ) );
table.addElement( new TR()
.addElement( new TH( "Attribute" ) )
.addElement( new TH( "String Value" ) ) );
Enumeration names = context.getAttributeNames();
while ( names.hasMoreElements() ) {
String name = (String) names.nextElement();
table.addElement( new TR()
.addElement( new TD( name ) )
.addElement( new TD( context.getAttribute( name ).toString() ) ) );
}
table.addElement( new TR()
.addElement( new TH( "InitParameter" ) )
.addElement( new TH( "String Value" ) ) );
Enumeration ipnames = context.getInitParameterNames();
while ( ipnames.hasMoreElements() ) {
String ipname = (String) ipnames.nextElement();
table.addElement( new TR()
.addElement( new TD( ipname ) )
.addElement( new TD( context.getInitParameter( ipname ).toString() ) ) );
}
} catch (Throwable t) {
logger.error("Throwable", t);
table.addElement( new TR()
.addElement( new TD( "Error" ) )
.addElement( new TD( "Could not read servlet context" ) ) );
}
return table;
}