FileDocCategorySizeDatePackage
SSISet.javaAPI DocApache Tomcat 6.0.142663Fri Jul 20 04:20:36 BST 2007org.apache.catalina.ssi

SSISet

public class SSISet extends Object implements SSICommand
Implements the Server-side #set command
author
Paul Speed
author
Dan Sandberg
author
David Becker
version
$Revision: 531303 $, $Date: 2007-04-23 02:24:01 +0200 (lun., 23 avr. 2007) $

Fields Summary
Constructors Summary
Methods Summary
public longprocess(SSIMediator ssiMediator, java.lang.String commandName, java.lang.String[] paramNames, java.lang.String[] paramValues, java.io.PrintWriter writer)

see
SSICommand

        long lastModified = 0;
        String errorMessage = ssiMediator.getConfigErrMsg();
        String variableName = null;
        for (int i = 0; i < paramNames.length; i++) {
            String paramName = paramNames[i];
            String paramValue = paramValues[i];
            if (paramName.equalsIgnoreCase("var")) {
                variableName = paramValue;
            } else if (paramName.equalsIgnoreCase("value")) {
                if (variableName != null) {
                    String substitutedValue = ssiMediator
                            .substituteVariables(paramValue);
                    ssiMediator.setVariableValue(variableName,
                            substitutedValue);
                    lastModified = System.currentTimeMillis();
                } else {
                    ssiMediator.log("#set--no variable specified");
                    writer.write(errorMessage);
                    throw new SSIStopProcessingException();
                }
            } else {
                ssiMediator.log("#set--Invalid attribute: " + paramName);
                writer.write(errorMessage);
                throw new SSIStopProcessingException();
            }
        }
        return lastModified;