Class SSIEcho

  • All Implemented Interfaces:
    SSICommand

    public class SSIEcho
    extends java.lang.Object
    implements SSICommand
    Return the result associated with the supplied Server Variable. Implements the Server-side #echo command.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String DEFAULT_ENCODING
      Default encoding for echo output.
      protected static java.lang.String MISSING_VARIABLE_VALUE
      Value returned when a requested variable is not found.
    • Constructor Summary

      Constructors 
      Constructor Description
      SSIEcho()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean isValidEncoding​(java.lang.String encoding)
      Checks if the given encoding name is one of the supported encodings.
      long process​(SSIMediator ssiMediator, java.lang.String commandName, java.lang.String[] paramNames, java.lang.String[] paramValues, java.io.PrintWriter writer)
      Processes the echo directive to output the value of a server variable.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_ENCODING

        protected static final java.lang.String DEFAULT_ENCODING
        Default encoding for echo output.
        See Also:
        Constant Field Values
      • MISSING_VARIABLE_VALUE

        protected static final java.lang.String MISSING_VARIABLE_VALUE
        Value returned when a requested variable is not found.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SSIEcho

        public SSIEcho()
        Default constructor.
    • Method Detail

      • process

        public long process​(SSIMediator ssiMediator,
                            java.lang.String commandName,
                            java.lang.String[] paramNames,
                            java.lang.String[] paramValues,
                            java.io.PrintWriter writer)
        Processes the echo directive to output the value of a server variable.
        Specified by:
        process in interface SSICommand
        Parameters:
        ssiMediator - the ssi mediator
        commandName - the name of the actual command ( ie. echo )
        paramNames - The parameter names
        paramValues - The parameter values
        writer - the writer to output to
        Returns:
        the most current modified date resulting from any SSI commands
      • isValidEncoding

        protected boolean isValidEncoding​(java.lang.String encoding)
        Checks if the given encoding name is one of the supported encodings.
        Parameters:
        encoding - the encoding name to check
        Returns:
        true if the encoding is valid