if (DEBUG)
{
// If there are GET/POST/PATH_INFO variables put them into
// a <PRE></PRE> tag so that they can be displayed on the
// page. This is of course only for example purposes.
PRE pre = new PRE();
Enumeration keys = data.getParameters().keys();
while ( keys.hasMoreElements() )
{
String key = (String) keys.nextElement();
String[] values = data.getParameters().getStrings(key);
if (values.length == 1)
pre.addElement(key + " = " + values[0] + "\n");
else
{
pre.addElement(key + " = ");
for (int i=0; i<values.length; i++)
pre.addElement(values[i] + " ");
pre.addElement("\n");
}
}
body.addElement( new B("Query/PathInfo Parameters") )
.addElement( new BR() )
.addElement(pre);
Table table2 = new Table().setBorder(0);
Hashtable varDebug = data.getVarDebug();
keys = varDebug.keys();
boolean hasValues2 = false;
while ( keys.hasMoreElements() )
{
String key = (String) keys.nextElement();
String value = varDebug.get(key).toString();
TR tr = new TR()
.addElement ( new TD().addElement(new B(key)) )
.addElement ( new TD().addElement(" = " + value ) );
table2.addElement(tr);
hasValues2 = true;
}
if ( hasValues2 )
{
body.addElement (new H4().addElement("Debugging Data:"));
body.addElement (table2);
}
}
if (DEBUG && data.getACL() != null)
{
// Print out user's permissions.
PRE pre = new PRE();
Iterator rs = data.getACL().getRoles().elements();
while ( rs.hasNext() )
{
String roleName = ((Role)rs.next()).getName();
pre.addElement(roleName + "\n");
}
body
.addElement( new BR() )
.addElement( new B("ROLES") )
.addElement( new BR() )
.addElement(pre);
pre = new PRE();
Iterator ps = data.getACL().getPermissions().elements();
while ( ps.hasNext() )
{
String permissionName = ((Permission)ps.next()).getName();
pre.addElement(permissionName + "\n");
}
body
.addElement( new BR() )
.addElement( new B("PERMISSIONS") )
.addElement( new BR() )