org.apache.catalina.ssi

Class SSIServletExternalResolver

Implemented Interfaces:
SSIExternalResolver

public class SSIServletExternalResolver
extends java.lang.Object
implements SSIExternalResolver

An implementation of SSIExternalResolver that is used with servlets.

Version:
$Revision: 1.3.2.1 $, $Date: 2004/09/01 16:31:01 $

Author:
Dan Sandberg

Nested Class Summary

protected class
SSIServletExternalResolver.ServletContextAndPath

Field Summary

protected String[]
VARIABLE_NAMES
protected int
debug
protected boolean
isVirtualWebappRelative
protected HttpServletRequest
req
protected HttpServletResponse
res
protected HttpServlet
servlet

Constructor Summary

SSIServletExternalResolver(HttpServlet servlet, HttpServletRequest req, HttpServletResponse res, boolean isVirtualWebappRelative, int debug)

Method Summary

void
addVariableNames(Collection variableNames)
protected String
getAbsolutePath(String path)
protected String
getCGIVariable(String name)
Date
getCurrentDate()
long
getFileLastModified(String path, boolean virtual)
long
getFileSize(String path, boolean virtual)
String
getFileText(String originalPath, boolean virtual)
protected String
getPathWithoutContext(String servletPath)
protected String
getPathWithoutFileName(String servletPath)
protected Object
getReqAttributeIgnoreCase(String targetName)
protected SSIServletExternalResolver.ServletContextAndPath
getServletContextAndPath(String originalPath, boolean virtual)
protected SSIServletExternalResolver.ServletContextAndPath
getServletContextAndPathFromNonVirtualPath(String nonVirtualPath)
protected SSIServletExternalResolver.ServletContextAndPath
getServletContextAndPathFromVirtualPath(String virtualPath)
protected URLConnection
getURLConnection(String originalPath, boolean virtual)
String
getVariableValue(String name)
protected boolean
isNameReserved(String name)
protected boolean
isRootContext(ServletContext servletContext)
void
log(String message, Throwable throwable)
protected String
nullToEmptyString(String string)
void
setVariableValue(String name, String value)

Field Details

VARIABLE_NAMES

protected final String[] VARIABLE_NAMES


debug

protected int debug


isVirtualWebappRelative

protected boolean isVirtualWebappRelative


req

protected HttpServletRequest req


res

protected HttpServletResponse res


servlet

protected HttpServlet servlet

Constructor Details

SSIServletExternalResolver

public SSIServletExternalResolver(HttpServlet servlet,
                                  HttpServletRequest req,
                                  HttpServletResponse res,
                                  boolean isVirtualWebappRelative,
                                  int debug)

Method Details

addVariableNames

public void addVariableNames(Collection variableNames)
Specified by:
addVariableNames in interface SSIExternalResolver


getAbsolutePath

protected String getAbsolutePath(String path)
            throws IOException


getCGIVariable

protected String getCGIVariable(String name)


getCurrentDate

public Date getCurrentDate()
Specified by:
getCurrentDate in interface SSIExternalResolver


getFileLastModified

public long getFileLastModified(String path,
                                boolean virtual)
            throws IOException
Specified by:
getFileLastModified in interface SSIExternalResolver


getFileSize

public long getFileSize(String path,
                        boolean virtual)
            throws IOException
Specified by:
getFileSize in interface SSIExternalResolver


getFileText

public String getFileText(String originalPath,
                          boolean virtual)
            throws IOException
Specified by:
getFileText in interface SSIExternalResolver


getPathWithoutContext

protected String getPathWithoutContext(String servletPath)


getPathWithoutFileName

protected String getPathWithoutFileName(String servletPath)


getReqAttributeIgnoreCase

protected Object getReqAttributeIgnoreCase(String targetName)


getServletContextAndPath

protected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPath(String originalPath,
                                                                                    boolean virtual)
            throws IOException


getServletContextAndPathFromNonVirtualPath

protected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromNonVirtualPath(String nonVirtualPath)
            throws IOException


getServletContextAndPathFromVirtualPath

protected SSIServletExternalResolver.ServletContextAndPath getServletContextAndPathFromVirtualPath(String virtualPath)
            throws IOException


getURLConnection

protected URLConnection getURLConnection(String originalPath,
                                         boolean virtual)
            throws IOException


getVariableValue

public String getVariableValue(String name)
Specified by:
getVariableValue in interface SSIExternalResolver


isNameReserved

protected boolean isNameReserved(String name)


isRootContext

protected boolean isRootContext(ServletContext servletContext)


log

public void log(String message,
                Throwable throwable)
Specified by:
log in interface SSIExternalResolver


nullToEmptyString

protected String nullToEmptyString(String string)


setVariableValue

public void setVariableValue(String name,
                             String value)
Specified by:
setVariableValue in interface SSIExternalResolver


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.