Package org.apache.catalina.ssi
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 SummaryNested ClassesModifier and TypeClassDescriptionprotected static class
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final ServletContextprotected final intprotected final Stringprotected final booleanprotected final HttpServletRequestprotected final HttpServletResponseprotected final String[]
- 
Constructor SummaryConstructorsConstructorDescriptionSSIServletExternalResolver(ServletContext context, HttpServletRequest req, HttpServletResponse res, boolean isVirtualWebappRelative, int debug, String inputEncoding) 
- 
Method SummaryModifier 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
- 
isVirtualWebappRelativeprotected final boolean isVirtualWebappRelative
- 
debugprotected final int debug
- 
inputEncoding
 
- 
- 
Constructor Details- 
SSIServletExternalResolverpublic SSIServletExternalResolver(ServletContext context, HttpServletRequest req, HttpServletResponse res, boolean isVirtualWebappRelative, int debug, String inputEncoding) 
 
- 
- 
Method Details- 
log- Specified by:
- login interface- SSIExternalResolver
 
- 
addVariableNamesDescription copied from interface:SSIExternalResolverAdds any external variables to the variableNames collection.- Specified by:
- addVariableNamesin interface- SSIExternalResolver
- Parameters:
- variableNames- the collection to add to
 
- 
getReqAttributeIgnoreCase
- 
isNameReserved
- 
setVariableValueDescription 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 interface- SSIExternalResolver
- Parameters:
- name- of the variable
- value- of the variable
 
- 
getVariableValue- Specified by:
- getVariableValuein interface- SSIExternalResolver
 
- 
getCGIVariable
- 
getCurrentDateDescription 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 interface- SSIExternalResolver
- Returns:
- the data
 
- 
nullToEmptyString
- 
getPathWithoutFileName
- 
getPathWithoutContext
- 
getAbsolutePath- Throws:
- IOException
 
- 
getServletContextAndPathFromNonVirtualPathprotected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromNonVirtualPath(String nonVirtualPath) throws IOException - Throws:
- IOException
 
- 
getServletContextAndPathFromVirtualPathprotected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromVirtualPath(String virtualPath) throws IOException - Throws:
- IOException
 
- 
isRootContext
- 
getServletContextAndPathprotected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPath(String originalPath, boolean virtual) throws IOException - Throws:
- IOException
 
- 
getURLConnection- Throws:
- IOException
 
- 
getFileLastModified- Specified by:
- getFileLastModifiedin interface- SSIExternalResolver
- Throws:
- IOException
 
- 
getFileSize- Specified by:
- getFileSizein interface- SSIExternalResolver
- Throws:
- IOException
 
- 
getFileText- Specified by:
- getFileTextin interface- SSIExternalResolver
- Throws:
- IOException
 
 
-