org.directwebremoting.servlet
Class JavaScriptHandler

java.lang.Object
  extended by org.directwebremoting.servlet.CachingHandler
      extended by org.directwebremoting.servlet.TemplateHandler
          extended by org.directwebremoting.servlet.JavaScriptHandler
All Implemented Interfaces:
Handler
Direct Known Subclasses:
FileJavaScriptHandler, GeneratedJavaScriptHandler

public abstract class JavaScriptHandler
extends TemplateHandler

Once we know a resource is JavaScript, we can go about compressing it.

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

Constructor Summary
JavaScriptHandler()
          Setup the JavaScriptHandler defaults
 
Method Summary
 java.lang.String generateCachableContent(java.lang.String contextPath, java.lang.String servletPath, java.lang.String pathInfo)
          Create a String which can be cached and sent as a 302.
 void setCompressor(Compressor compressor)
          Setter for the current JavaScript compression library
 void setDebug(boolean debug)
          In debug mode we don't do compression at all
 
Methods inherited from class org.directwebremoting.servlet.CachingHandler
getMimeType, handle, setIgnoreLastModified, setMimeType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptHandler

public JavaScriptHandler()
Setup the JavaScriptHandler defaults

Method Detail

generateCachableContent

public java.lang.String generateCachableContent(java.lang.String contextPath,
                                                java.lang.String servletPath,
                                                java.lang.String pathInfo)
                                         throws java.io.IOException
Description copied from class: CachingHandler
Create a String which can be cached and sent as a 302. Returning null signals that the resource doesn't exist and should result in a 404.

Overrides:
generateCachableContent in class TemplateHandler
Returns:
The string to output for this resource
Throws:
java.io.IOException

setCompressor

public void setCompressor(Compressor compressor)
Setter for the current JavaScript compression library

Parameters:
compressor - The new compression library

setDebug

public void setDebug(boolean debug)
In debug mode we don't do compression at all


Copyright ยจ 2008