MCPcopy Create free account
hub / github.com/apache/tomcat / process

Method process

java/org/apache/catalina/ssi/SSISet.java:49–77  ·  view source on GitHub ↗

Process the SSI #set command. @param ssiMediator the SSI mediator @param commandName the command name @param paramNames the parameter names @param paramValues the parameter values @param writer the print writer for output @return the last modified timestamp @throws SSIStopProcessingExc

(SSIMediator ssiMediator, String commandName, String[] paramNames, String[] paramValues,
            PrintWriter writer)

Source from the content-addressed store, hash-verified

47 * @throws SSIStopProcessingException if processing should stop
48 */
49 @Override
50 public long process(SSIMediator ssiMediator, String commandName, String[] paramNames, String[] paramValues,
51 PrintWriter writer) throws SSIStopProcessingException {
52 long lastModified = 0;
53 String errorMessage = ssiMediator.getConfigErrMsg();
54 String variableName = null;
55 for (int i = 0; i < paramNames.length; i++) {
56 String paramName = paramNames[i];
57 String paramValue = paramValues[i];
58 if (paramName.equalsIgnoreCase("var")) {
59 variableName = paramValue;
60 } else if (paramName.equalsIgnoreCase("value")) {
61 if (variableName != null) {
62 String substitutedValue = ssiMediator.substituteVariables(paramValue);
63 ssiMediator.setVariableValue(variableName, substitutedValue);
64 lastModified = System.currentTimeMillis();
65 } else {
66 ssiMediator.log(sm.getString("ssiSet.noVariable"));
67 writer.write(errorMessage);
68 throw new SSIStopProcessingException();
69 }
70 } else {
71 ssiMediator.log(sm.getString("ssiCommand.invalidAttribute", paramName));
72 writer.write(errorMessage);
73 throw new SSIStopProcessingException();
74 }
75 }
76 return lastModified;
77 }
78}

Callers

nothing calls this directly

Calls 7

getConfigErrMsgMethod · 0.80
substituteVariablesMethod · 0.80
setVariableValueMethod · 0.65
logMethod · 0.65
getStringMethod · 0.65
writeMethod · 0.65
equalsIgnoreCaseMethod · 0.45

Tested by

no test coverage detected