Package org.apache.catalina.ssi
Class SSIServletExternalResolver
- java.lang.Object
- 
- org.apache.catalina.ssi.SSIServletExternalResolver
 
- 
- All Implemented Interfaces:
- SSIExternalResolver
 
 public class SSIServletExternalResolver extends java.lang.Object implements SSIExternalResolver An implementation of SSIExternalResolver that is used with servlets.- Author:
- Dan Sandberg, David Becker
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classSSIServletExternalResolver.ServletContextAndPath
 - 
Field SummaryFields Modifier and Type Field Description protected ServletContextcontextprotected intdebugprotected java.lang.StringinputEncodingprotected booleanisVirtualWebappRelativeprotected HttpServletRequestreqprotected HttpServletResponseresprotected java.lang.String[]VARIABLE_NAMES
 - 
Constructor SummaryConstructors Constructor Description SSIServletExternalResolver(ServletContext context, HttpServletRequest req, HttpServletResponse res, boolean isVirtualWebappRelative, int debug, java.lang.String inputEncoding)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVariableNames(java.util.Collection<java.lang.String> variableNames)Adds any external variables to the variableNames collection.protected java.lang.StringgetAbsolutePath(java.lang.String path)protected java.lang.StringgetCGIVariable(java.lang.String name)java.util.DategetCurrentDate()Returns the current date.longgetFileLastModified(java.lang.String path, boolean virtual)longgetFileSize(java.lang.String path, boolean virtual)java.lang.StringgetFileText(java.lang.String originalPath, boolean virtual)protected java.lang.StringgetPathWithoutContext(java.lang.String contextPath, java.lang.String servletPath)protected java.lang.StringgetPathWithoutFileName(java.lang.String servletPath)protected java.lang.ObjectgetReqAttributeIgnoreCase(java.lang.String targetName)protected SSIServletExternalResolver.ServletContextAndPathgetServletContextAndPath(java.lang.String originalPath, boolean virtual)protected SSIServletExternalResolver.ServletContextAndPathgetServletContextAndPathFromNonVirtualPath(java.lang.String nonVirtualPath)protected SSIServletExternalResolver.ServletContextAndPathgetServletContextAndPathFromVirtualPath(java.lang.String virtualPath)protected java.net.URLConnectiongetURLConnection(java.lang.String originalPath, boolean virtual)java.lang.StringgetVariableValue(java.lang.String name)protected booleanisNameReserved(java.lang.String name)protected booleanisRootContext(ServletContext servletContext)voidlog(java.lang.String message, java.lang.Throwable throwable)protected java.lang.StringnullToEmptyString(java.lang.String string)voidsetVariableValue(java.lang.String name, java.lang.String value)Set the named variable to the specified value.
 
- 
- 
- 
Field Detail- 
VARIABLE_NAMESprotected final java.lang.String[] VARIABLE_NAMES 
 - 
contextprotected final ServletContext context 
 - 
reqprotected final HttpServletRequest req 
 - 
resprotected final HttpServletResponse res 
 - 
isVirtualWebappRelativeprotected final boolean isVirtualWebappRelative 
 - 
debugprotected final int debug 
 - 
inputEncodingprotected final java.lang.String inputEncoding 
 
- 
 - 
Constructor Detail- 
SSIServletExternalResolverpublic SSIServletExternalResolver(ServletContext context, HttpServletRequest req, HttpServletResponse res, boolean isVirtualWebappRelative, int debug, java.lang.String inputEncoding) 
 
- 
 - 
Method Detail- 
logpublic void log(java.lang.String message, java.lang.Throwable throwable)- Specified by:
- login interface- SSIExternalResolver
 
 - 
addVariableNamespublic void addVariableNames(java.util.Collection<java.lang.String> variableNames) Description copied from interface:SSIExternalResolverAdds any external variables to the variableNames collection.- Specified by:
- addVariableNamesin interface- SSIExternalResolver
- Parameters:
- variableNames- the collection to add to
 
 - 
getReqAttributeIgnoreCaseprotected java.lang.Object getReqAttributeIgnoreCase(java.lang.String targetName) 
 - 
isNameReservedprotected boolean isNameReserved(java.lang.String name) 
 - 
setVariableValuepublic void setVariableValue(java.lang.String name, java.lang.String value)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 interface- SSIExternalResolver
- Parameters:
- name- of the variable
- value- of the variable
 
 - 
getVariableValuepublic java.lang.String getVariableValue(java.lang.String name) - Specified by:
- getVariableValuein interface- SSIExternalResolver
 
 - 
getCGIVariableprotected java.lang.String getCGIVariable(java.lang.String name) 
 - 
getCurrentDatepublic java.util.Date 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 interface- SSIExternalResolver
- Returns:
- the data
 
 - 
nullToEmptyStringprotected java.lang.String nullToEmptyString(java.lang.String string) 
 - 
getPathWithoutFileNameprotected java.lang.String getPathWithoutFileName(java.lang.String servletPath) 
 - 
getPathWithoutContextprotected java.lang.String getPathWithoutContext(java.lang.String contextPath, java.lang.String servletPath)
 - 
getAbsolutePathprotected java.lang.String getAbsolutePath(java.lang.String path) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getServletContextAndPathFromNonVirtualPathprotected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromNonVirtualPath(java.lang.String nonVirtualPath) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
getServletContextAndPathFromVirtualPathprotected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromVirtualPath(java.lang.String virtualPath) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
isRootContextprotected boolean isRootContext(ServletContext servletContext) 
 - 
getServletContextAndPathprotected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPath(java.lang.String originalPath, boolean virtual) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
getURLConnectionprotected java.net.URLConnection getURLConnection(java.lang.String originalPath, boolean virtual) throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
getFileLastModifiedpublic long getFileLastModified(java.lang.String path, boolean virtual) throws java.io.IOException- Specified by:
- getFileLastModifiedin interface- SSIExternalResolver
- Throws:
- java.io.IOException
 
 - 
getFileSizepublic long getFileSize(java.lang.String path, boolean virtual) throws java.io.IOException- Specified by:
- getFileSizein interface- SSIExternalResolver
- Throws:
- java.io.IOException
 
 - 
getFileTextpublic java.lang.String getFileText(java.lang.String originalPath, boolean virtual) throws java.io.IOException- Specified by:
- getFileTextin interface- SSIExternalResolver
- Throws:
- java.io.IOException
 
 
- 
 
-