SSIPrintenvpublic class SSIPrintenv extends Object implements SSICommandImplements the Server-side #printenv command |
Methods Summary |
---|
public long | process(SSIMediator ssiMediator, java.lang.String commandName, java.lang.String[] paramNames, java.lang.String[] paramValues, java.io.PrintWriter writer)
long lastModified = 0;
//any arguments should produce an error
if (paramNames.length > 0) {
String errorMessage = ssiMediator.getConfigErrMsg();
writer.write(errorMessage);
} else {
Collection variableNames = ssiMediator.getVariableNames();
Iterator iter = variableNames.iterator();
while (iter.hasNext()) {
String variableName = (String)iter.next();
String variableValue = ssiMediator
.getVariableValue(variableName);
//This shouldn't happen, since all the variable names must
// have values
if (variableValue == null) {
variableValue = "(none)";
}
writer.write(variableName);
writer.write('=");
writer.write(variableValue);
writer.write('\n");
lastModified = System.currentTimeMillis();
}
}
return lastModified;
|
|