org.directwebremoting.servlet
Class FileHandler

java.lang.Object
  extended by org.directwebremoting.servlet.FileHandler
All Implemented Interfaces:
Handler, InitializingBean
Direct Known Subclasses:
AuthHandler, EngineHandler, UtilHandler, WebworkUtilHandler

public class FileHandler
extends java.lang.Object
implements Handler, InitializingBean

Basically a file servlet component that does some very limitted EL type processing on the file. See the source for the cheat.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
FileHandler()
          Create a new FileHandler
FileHandler(java.lang.String filePath, java.lang.String mimeType, boolean dynamic)
          Create a new FileHandler
 
Method Summary
 void afterContainerSetup(Container container)
          This method allows the bean instance to perform initialization only possible when all bean properties have been set
 void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle a URL request that has been mapped to this Handler
 void setAllowGetForSafariButMakeForgeryEasier(boolean allowGetForSafariButMakeForgeryEasier)
           
 void setCompressionLevel(int compressionLevel)
           
 void setDynamic(boolean dynamic)
          Are we expected to do the minor EL type processing?
 void setFilePath(java.lang.String filePath)
           
 void setIgnoreLastModified(boolean ignoreLastModified)
           
 void setMaxWaitAfterWrite(int maxWaitAfterWrite)
          Sometimes with proxies, you need to close the stream all the time to make the flush work.
 void setMimeType(java.lang.String mimeType)
          The mime type to send the output under
 void setOverridePath(java.lang.String overridePath)
          If we need to override the default path
 void setScriptCompressed(boolean scriptCompressed)
          To what level do we compress scripts?
 void setScriptTagProtection(java.lang.String scriptTagProtection)
          What is the string we use for script tag hack protection
 void setSessionCookieName(java.lang.String sessionCookieName)
          Alter the session cookie name from the default JSESSIONID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileHandler

public FileHandler(java.lang.String filePath,
                   java.lang.String mimeType,
                   boolean dynamic)
Create a new FileHandler

Parameters:
filePath - The filePath to search for, process and output
mimeType - The mime type to use for this output file
dynamic - Should the script be recalculated each time?

FileHandler

public FileHandler()
Create a new FileHandler

Method Detail

afterContainerSetup

public void afterContainerSetup(Container container)
Description copied from interface: InitializingBean

This method allows the bean instance to perform initialization only possible when all bean properties have been set

Specified by:
afterContainerSetup in interface InitializingBean
Parameters:
container - The container that is doing the initialization

handle

public void handle(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException
Description copied from interface: Handler
Handle a URL request that has been mapped to this Handler

Specified by:
handle in interface Handler
Parameters:
request - The HTTP request data
response - Where we write the HTTP response data
Throws:
java.io.IOException - If the write process fails

setAllowGetForSafariButMakeForgeryEasier

public void setAllowGetForSafariButMakeForgeryEasier(boolean allowGetForSafariButMakeForgeryEasier)
Parameters:
allowGetForSafariButMakeForgeryEasier - Do we reduce security to help Safari

setIgnoreLastModified

public void setIgnoreLastModified(boolean ignoreLastModified)
Parameters:
ignoreLastModified - The ignoreLastModified to set.

setSessionCookieName

public void setSessionCookieName(java.lang.String sessionCookieName)
Alter the session cookie name from the default JSESSIONID.

Parameters:
sessionCookieName - the sessionCookieName to set

setScriptCompressed

public void setScriptCompressed(boolean scriptCompressed)
To what level do we compress scripts?

Parameters:
scriptCompressed - The scriptCompressed to set.

setCompressionLevel

public void setCompressionLevel(int compressionLevel)
Parameters:
compressionLevel - The compressionLevel to set.

setFilePath

public void setFilePath(java.lang.String filePath)
Parameters:
filePath - the filePath to set

setDynamic

public void setDynamic(boolean dynamic)
Are we expected to do the minor EL type processing?

Parameters:
dynamic - the dynamic to set

setMimeType

public void setMimeType(java.lang.String mimeType)
The mime type to send the output under

Parameters:
mimeType - the mimeType to set

setScriptTagProtection

public void setScriptTagProtection(java.lang.String scriptTagProtection)
What is the string we use for script tag hack protection

Parameters:
scriptTagProtection - the scriptTagProtection to set

setOverridePath

public void setOverridePath(java.lang.String overridePath)
If we need to override the default path

Parameters:
overridePath - The new override path

setMaxWaitAfterWrite

public void setMaxWaitAfterWrite(int maxWaitAfterWrite)
Sometimes with proxies, you need to close the stream all the time to make the flush work. A value of -1 indicated that we do not do early closing after writes.

Parameters:
maxWaitAfterWrite - the maxWaitAfterWrite to set

Copyright ? 2005