org.apache.catalina.ssi
Class SSIServletExternalResolver
java.lang.Object
org.apache.catalina.ssi.SSIServletExternalResolver
- All Implemented Interfaces:
- SSIExternalResolver
public class SSIServletExternalResolver
- extends Object
- implements SSIExternalResolver
An implementation of SSIExternalResolver that is used with servlets.
- Version:
- $Id: SSIServletExternalResolver.java 1239053 2012-02-01 10:52:00Z markt $
- Author:
- Dan Sandberg, David Becker
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VARIABLE_NAMES
protected final String[] VARIABLE_NAMES
context
protected ServletContext context
req
protected HttpServletRequest req
res
protected HttpServletResponse res
isVirtualWebappRelative
protected boolean isVirtualWebappRelative
debug
protected int debug
inputEncoding
protected String inputEncoding
SSIServletExternalResolver
public SSIServletExternalResolver(ServletContext context,
HttpServletRequest req,
HttpServletResponse res,
boolean isVirtualWebappRelative,
int debug,
String inputEncoding)
log
public void log(String message,
Throwable throwable)
- Specified by:
log
in interface SSIExternalResolver
addVariableNames
public void addVariableNames(Collection<String> variableNames)
- Description copied from interface:
SSIExternalResolver
- Adds any external variables to the variableNames collection.
- Specified by:
addVariableNames
in interface SSIExternalResolver
- Parameters:
variableNames
- the collection to add to
getReqAttributeIgnoreCase
protected Object getReqAttributeIgnoreCase(String targetName)
isNameReserved
protected boolean isNameReserved(String name)
setVariableValue
public void setVariableValue(String name,
String value)
- Description copied from interface:
SSIExternalResolver
- Set 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:
setVariableValue
in interface SSIExternalResolver
- Parameters:
name
- of the variablevalue
- of the variable
getVariableValue
public String getVariableValue(String name)
- Specified by:
getVariableValue
in interface SSIExternalResolver
getCGIVariable
protected String getCGIVariable(String name)
getCurrentDate
public Date getCurrentDate()
- Description copied from interface:
SSIExternalResolver
- Returns 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:
getCurrentDate
in interface SSIExternalResolver
- Returns:
- the data
nullToEmptyString
protected String nullToEmptyString(String string)
getPathWithoutFileName
protected String getPathWithoutFileName(String servletPath)
getPathWithoutContext
protected String getPathWithoutContext(String contextPath,
String servletPath)
getAbsolutePath
protected String getAbsolutePath(String path)
throws IOException
- 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
protected boolean isRootContext(ServletContext servletContext)
getServletContextAndPath
protected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPath(String originalPath,
boolean virtual)
throws IOException
- Throws:
IOException
getURLConnection
protected URLConnection getURLConnection(String originalPath,
boolean virtual)
throws IOException
- Throws:
IOException
getFileLastModified
public long getFileLastModified(String path,
boolean virtual)
throws IOException
- Specified by:
getFileLastModified
in interface SSIExternalResolver
- Throws:
IOException
getFileSize
public long getFileSize(String path,
boolean virtual)
throws IOException
- Specified by:
getFileSize
in interface SSIExternalResolver
- Throws:
IOException
getFileText
public String getFileText(String originalPath,
boolean virtual)
throws IOException
- Specified by:
getFileText
in interface SSIExternalResolver
- Throws:
IOException
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.