1 11 package org.apache.catalina.ssi; 12 13 14 import java.io.PrintWriter ; 15 24 public final class SSIConfig implements SSICommand { 25 28 public long process(SSIMediator ssiMediator, String commandName, 29 String [] paramNames, String [] paramValues, PrintWriter writer) { 30 for (int i = 0; i < paramNames.length; i++) { 31 String paramName = paramNames[i]; 32 String paramValue = paramValues[i]; 33 String substitutedValue = ssiMediator 34 .substituteVariables(paramValue); 35 if (paramName.equalsIgnoreCase("errmsg")) { 36 ssiMediator.setConfigErrMsg(substitutedValue); 37 } else if (paramName.equalsIgnoreCase("sizefmt")) { 38 ssiMediator.setConfigSizeFmt(substitutedValue); 39 } else if (paramName.equalsIgnoreCase("timefmt")) { 40 ssiMediator.setConfigTimeFmt(substitutedValue); 41 } else { 42 ssiMediator.log("#config--Invalid attribute: " + paramName); 43 String configErrMsg = ssiMediator.getConfigErrMsg(); 47 writer.write(configErrMsg); 48 } 49 } 50 return 0; 52 } 53 } | Popular Tags |