Class SSIServletExternalResolver
java.lang.Object
org.apache.catalina.ssi.SSIServletExternalResolver
- All Implemented Interfaces:
SSIExternalResolver
An implementation of SSIExternalResolver that is used with servlets.
- Author:
- Dan Sandberg, David Becker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ServletContextprotected final intprotected final Stringprotected final booleanprotected final HttpServletRequestprotected final HttpServletResponseprotected final String[] -
Constructor Summary
ConstructorsConstructorDescriptionSSIServletExternalResolver(ServletContext context, HttpServletRequest req, HttpServletResponse res, boolean isVirtualWebappRelative, int debug, String inputEncoding) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariableNames(Collection<String> variableNames) Adds any external variables to the variableNames collection.protected StringgetAbsolutePath(String path) protected StringgetCGIVariable(String name) Returns the current date.longgetFileLastModified(String path, boolean virtual) longgetFileSize(String path, boolean virtual) getFileText(String originalPath, boolean virtual) protected StringgetPathWithoutContext(String contextPath, String servletPath) protected StringgetPathWithoutFileName(String servletPath) protected ObjectgetReqAttributeIgnoreCase(String targetName) getServletContextAndPath(String originalPath, boolean virtual) getServletContextAndPathFromNonVirtualPath(String nonVirtualPath) getServletContextAndPathFromVirtualPath(String virtualPath) protected URLConnectiongetURLConnection(String originalPath, boolean virtual) getVariableValue(String name) protected booleanisNameReserved(String name) protected booleanisRootContext(ServletContext servletContext) voidprotected StringnullToEmptyString(String string) voidsetVariableValue(String name, String value) Set the named variable to the specified value.
-
Field Details
-
VARIABLE_NAMES
-
context
-
req
-
res
-
isVirtualWebappRelative
protected final boolean isVirtualWebappRelative -
debug
protected final int debug -
inputEncoding
-
-
Constructor Details
-
SSIServletExternalResolver
public SSIServletExternalResolver(ServletContext context, HttpServletRequest req, HttpServletResponse res, boolean isVirtualWebappRelative, int debug, String inputEncoding)
-
-
Method Details
-
log
- Specified by:
login interfaceSSIExternalResolver
-
addVariableNames
Description copied from interface:SSIExternalResolverAdds any external variables to the variableNames collection.- Specified by:
addVariableNamesin interfaceSSIExternalResolver- Parameters:
variableNames- the collection to add to
-
getReqAttributeIgnoreCase
-
isNameReserved
-
setVariableValue
Description copied from interface:SSIExternalResolverSet the named variable to the specified value. If value is null, then the variable will be removed ( ie. a call to getVariableValue will return null )- Specified by:
setVariableValuein interfaceSSIExternalResolver- Parameters:
name- of the variablevalue- of the variable
-
getVariableValue
- Specified by:
getVariableValuein interfaceSSIExternalResolver
-
getCGIVariable
-
getCurrentDate
Description copied from interface:SSIExternalResolverReturns the current date. This is useful for putting the SSI stuff in a regression test. Since you can make the current date a constant, it makes testing easier since the output won't change.- Specified by:
getCurrentDatein interfaceSSIExternalResolver- Returns:
- the data
-
nullToEmptyString
-
getPathWithoutFileName
-
getPathWithoutContext
-
getAbsolutePath
- Throws:
IOException
-
getServletContextAndPathFromNonVirtualPath
protected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromNonVirtualPath(String nonVirtualPath) throws IOException - Throws:
IOException
-
getServletContextAndPathFromVirtualPath
protected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromVirtualPath(String virtualPath) throws IOException - Throws:
IOException
-
isRootContext
-
getServletContextAndPath
protected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPath(String originalPath, boolean virtual) throws IOException - Throws:
IOException
-
getURLConnection
- Throws:
IOException
-
getFileLastModified
- Specified by:
getFileLastModifiedin interfaceSSIExternalResolver- Throws:
IOException
-
getFileSize
- Specified by:
getFileSizein interfaceSSIExternalResolver- Throws:
IOException
-
getFileText
- Specified by:
getFileTextin interfaceSSIExternalResolver- Throws:
IOException
-