1 11 package org.apache.catalina.ssi; 12 13 14 import java.io.PrintWriter ; 15 import java.util.Collection ; 16 import java.util.Iterator ; 17 24 public class SSIPrintenv implements SSICommand { 25 28 public long process(SSIMediator ssiMediator, String commandName, 29 String [] paramNames, String [] paramValues, PrintWriter writer) { 30 long lastModified = 0; 31 if (paramNames.length > 0) { 33 String errorMessage = ssiMediator.getConfigErrMsg(); 34 writer.write(errorMessage); 35 } else { 36 Collection variableNames = ssiMediator.getVariableNames(); 37 Iterator iter = variableNames.iterator(); 38 while (iter.hasNext()) { 39 String variableName = (String )iter.next(); 40 String variableValue = ssiMediator 41 .getVariableValue(variableName); 42 if (variableValue == null) { 45 variableValue = "(none)"; 46 } 47 writer.write(variableName); 48 writer.write('='); 49 writer.write(variableValue); 50 writer.write('\n'); 51 lastModified = System.currentTimeMillis(); 52 } 53 } 54 return lastModified; 55 } 56 } 57 | Popular Tags |