org.springframework.js.resource
Class ResourceServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.springframework.web.servlet.HttpServletBean
              extended by org.springframework.js.resource.ResourceServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ResourceServlet
extends org.springframework.web.servlet.HttpServletBean

Special resource servlet for efficiently resolving and rendering static resources from within a JAR file.

Author:
Jeremy Grelle, Scott Andrews
See Also:
Serialized Form

Constructor Summary
ResourceServlet()
           
 
Method Summary
 void setAllowedResourcePaths(String allowedResourcePaths)
          Set allowed resources as an comma separated String of URL patterns, e.g.
 void setCacheTimeout(int cacheTimeout)
          Set the number of seconds resources should be cached by the client.
 void setCompressedMimeTypes(String compressedMimeTypes)
          Set comma separated MIME types that should have gzip compression applied.
 void setGzipEnabled(boolean gzipEnabled)
          Set whether to apply gzip compression to resources if the requesting client supports it.
 void setJarPathPrefix(String jarPathPrefix)
          Set the default path prefix to apply to resources being served from jar files.
 
Methods inherited from class org.springframework.web.servlet.HttpServletBean
getServletContext, getServletName, init
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceServlet

public ResourceServlet()
Method Detail

setGzipEnabled

public void setGzipEnabled(boolean gzipEnabled)
Set whether to apply gzip compression to resources if the requesting client supports it.


setAllowedResourcePaths

public void setAllowedResourcePaths(String allowedResourcePaths)
Set allowed resources as an comma separated String of URL patterns, e.g. "META-INF/** /*.js", The paths may be any Ant-style pattern parsable by AntPathMatcher.

See Also:
AntPathMatcher

setCompressedMimeTypes

public void setCompressedMimeTypes(String compressedMimeTypes)
Set comma separated MIME types that should have gzip compression applied. Typically, gzip compression is only useful for text based content. Ant-style patterns are supported, e.g. "text/*".

See Also:
AntPathMatcher

setJarPathPrefix

public void setJarPathPrefix(String jarPathPrefix)
Set the default path prefix to apply to resources being served from jar files. Default is "META-INF".


setCacheTimeout

public void setCacheTimeout(int cacheTimeout)
Set the number of seconds resources should be cached by the client. Zero disables caching. Default is one year.