org.apache.myfaces.commons.resourcehandler
Class ExtendedDefaultResourceHandlerSupport

java.lang.Object
  extended by org.apache.myfaces.commons.resourcehandler.resource.ResourceHandlerSupport
      extended by org.apache.myfaces.commons.resourcehandler.resource.BaseResourceHandlerSupport
          extended by org.apache.myfaces.commons.resourcehandler.ExtendedDefaultResourceHandlerSupport

public class ExtendedDefaultResourceHandlerSupport
extends BaseResourceHandlerSupport


Field Summary
protected static String CACHED_SERVLET_MAPPING
           
static String INIT_PARAM_CACHE_DISK_GZIP_RESOURCES
          Indicate if gzipped files are stored on a temporal directory to serve them later.
static String INIT_PARAM_EXTENDED_RESOURCE_IDENTIFIER
          Indicate the prefix that is added to each resource path that is used later to check if the request is a resource request.
static String INIT_PARAM_GZIP_RESOURCES_ENABLED
          Enable or disable gzip compressions for resources served by this extended resource handler.
static String INIT_PARAM_GZIP_RESOURCES_EXTENSIONS_DEFAULT
           
static String INIT_PARAM_GZIP_RESOURCES_SUFFIX
          Indicate the suffix used to recognize resources that should be compressed.
 
Fields inherited from class org.apache.myfaces.commons.resourcehandler.resource.BaseResourceHandlerSupport
RESOURCE_MAX_TIME_EXPIRES
 
Constructor Summary
ExtendedDefaultResourceHandlerSupport()
           
 
Method Summary
 String calculateResourceBasePath(javax.faces.context.FacesContext facesContext)
          Calculate the resource base path.
protected  FacesServletMapping getFacesServletMapping(javax.faces.context.FacesContext context)
          Read the web.xml file that is in the classpath and parse its internals to figure out how the FacesServlet is mapped for the current webapp.
 String[] getGzipResourcesSuffixes()
           
 MyFacesResourcesConfig getMyFacesResourcesConfig()
           
 String getResourceIdentifier()
           
 ResourceLoader[] getResourceLoaders()
          Return the resource loaders used.
 WebConfigProvider getWebConfigProvider()
           
 boolean isCacheDiskGzipResources()
           
 boolean isCompressable(javax.faces.application.Resource resource)
           
 boolean isCompressable(ResourceMeta resourceMeta)
           
 boolean isGzipResourcesEnabled()
           
 boolean userAgentSupportsCompression(javax.faces.context.FacesContext facesContext)
           
 
Methods inherited from class org.apache.myfaces.commons.resourcehandler.resource.BaseResourceHandlerSupport
calculateFacesServletMapping, getMapping, getMaxTimeExpires, getStartupTime, isExtensionMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHED_SERVLET_MAPPING

protected static final String CACHED_SERVLET_MAPPING

INIT_PARAM_GZIP_RESOURCES_ENABLED

@JSFWebConfigParam(defaultValue="false")
public static final String INIT_PARAM_GZIP_RESOURCES_ENABLED
Enable or disable gzip compressions for resources served by this extended resource handler. By default is disabled (false).

See Also:
Constant Field Values

INIT_PARAM_GZIP_RESOURCES_SUFFIX

@JSFWebConfigParam(defaultValue=".css, .js")
public static final String INIT_PARAM_GZIP_RESOURCES_SUFFIX
Indicate the suffix used to recognize resources that should be compressed. By default is ".css .js".

See Also:
Constant Field Values

INIT_PARAM_GZIP_RESOURCES_EXTENSIONS_DEFAULT

public static final String INIT_PARAM_GZIP_RESOURCES_EXTENSIONS_DEFAULT
See Also:
Constant Field Values

INIT_PARAM_CACHE_DISK_GZIP_RESOURCES

@JSFWebConfigParam(defaultValue="true")
public static final String INIT_PARAM_CACHE_DISK_GZIP_RESOURCES
Indicate if gzipped files are stored on a temporal directory to serve them later. By default is true. If this is disable, the files are compressed when they are served.

See Also:
Constant Field Values

INIT_PARAM_EXTENDED_RESOURCE_IDENTIFIER

@JSFWebConfigParam(defaultValue="/javax.faces.resource")
public static final String INIT_PARAM_EXTENDED_RESOURCE_IDENTIFIER
Indicate the prefix that is added to each resource path that is used later to check if the request is a resource request. By default is /javax.faces.resource

See Also:
Constant Field Values
Constructor Detail

ExtendedDefaultResourceHandlerSupport

public ExtendedDefaultResourceHandlerSupport()
Method Detail

getMyFacesResourcesConfig

public MyFacesResourcesConfig getMyFacesResourcesConfig()

getGzipResourcesSuffixes

public String[] getGzipResourcesSuffixes()

isGzipResourcesEnabled

public boolean isGzipResourcesEnabled()

isCacheDiskGzipResources

public boolean isCacheDiskGzipResources()

isCompressable

public boolean isCompressable(ResourceMeta resourceMeta)

isCompressable

public boolean isCompressable(javax.faces.application.Resource resource)

userAgentSupportsCompression

public boolean userAgentSupportsCompression(javax.faces.context.FacesContext facesContext)

calculateResourceBasePath

public String calculateResourceBasePath(javax.faces.context.FacesContext facesContext)
Description copied from class: ResourceHandlerSupport
Calculate the resource base path. It should extract a string like: ResourceHandler.RESOURCE_IDENTIFIER + '/' + getResourceName() For example: /javax.faces.resource/image.jpg This is used on ResourceHandler.handleResourceRequest()

Overrides:
calculateResourceBasePath in class BaseResourceHandlerSupport

getFacesServletMapping

protected FacesServletMapping getFacesServletMapping(javax.faces.context.FacesContext context)
Description copied from class: BaseResourceHandlerSupport
Read the web.xml file that is in the classpath and parse its internals to figure out how the FacesServlet is mapped for the current webapp.

Overrides:
getFacesServletMapping in class BaseResourceHandlerSupport

getResourceLoaders

public ResourceLoader[] getResourceLoaders()
Return the resource loaders used. Note this loaders should return ExtendedResourceMeta instances.

Overrides:
getResourceLoaders in class BaseResourceHandlerSupport
Returns:

getWebConfigProvider

public WebConfigProvider getWebConfigProvider()

getResourceIdentifier

public String getResourceIdentifier()
Overrides:
getResourceIdentifier in class ResourceHandlerSupport


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.