org.apache.myfaces.application
Class DefaultResourceHandlerSupport

java.lang.Object
  extended by org.apache.myfaces.application.DefaultResourceHandlerSupport
All Implemented Interfaces:
ResourceHandlerSupport

public class DefaultResourceHandlerSupport
extends java.lang.Object
implements ResourceHandlerSupport

A ResourceHandlerSupport implementation for use with standard Java Servlet engines, ie an engine that supports javax.servlet, and uses a standard web.xml file.

Version:
$Revision: 701829 $ $Date: 2008-10-05 12:06:02 -0500 (Sun, 05 Oct 2008) $
Author:
Leonardo Uribe (latest modification by $Author: slessard $)

Constructor Summary
DefaultResourceHandlerSupport()
           
 
Method Summary
protected static DefaultViewHandlerSupport.FacesServletMapping calculateFacesServletMapping(java.lang.String servletPath, java.lang.String pathInfo)
          Determines the mapping of the FacesServlet in the web.xml configuration file.
 java.lang.String calculateResourceBasePath(FacesContext facesContext)
          Calculate the resource base path.
protected  DefaultViewHandlerSupport.FacesServletMapping getFacesServletMapping(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.
 java.lang.String getMapping()
          Get the mapping used as prefix(/faces) or sufix(.jsf)
 ResourceLoader[] getResourceLoaders()
          Return an array of resource loaders used to find resources using the standard.
 boolean isExtensionMapping()
          Check if the mapping used is done using extensions (.xhtml, .jsf) or if it is not (/faces/*)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResourceHandlerSupport

public DefaultResourceHandlerSupport()
Method Detail

calculateResourceBasePath

public java.lang.String calculateResourceBasePath(FacesContext facesContext)
Description copied from interface: 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()

Specified by:
calculateResourceBasePath in interface ResourceHandlerSupport

getResourceLoaders

public ResourceLoader[] getResourceLoaders()
Description copied from interface: ResourceHandlerSupport
Return an array of resource loaders used to find resources using the standard. The order of ResourceLoaders define its precedence.

Specified by:
getResourceLoaders in interface ResourceHandlerSupport
Returns:

isExtensionMapping

public boolean isExtensionMapping()
Description copied from interface: ResourceHandlerSupport
Check if the mapping used is done using extensions (.xhtml, .jsf) or if it is not (/faces/*)

Specified by:
isExtensionMapping in interface ResourceHandlerSupport
Returns:

getMapping

public java.lang.String getMapping()
Description copied from interface: ResourceHandlerSupport
Get the mapping used as prefix(/faces) or sufix(.jsf)

Specified by:
getMapping in interface ResourceHandlerSupport
Returns:

getFacesServletMapping

protected DefaultViewHandlerSupport.FacesServletMapping getFacesServletMapping(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.


calculateFacesServletMapping

protected static DefaultViewHandlerSupport.FacesServletMapping calculateFacesServletMapping(java.lang.String servletPath,
                                                                                            java.lang.String pathInfo)
Determines the mapping of the FacesServlet in the web.xml configuration file. However, there is no need to actually parse this configuration file as runtime information is sufficient.

Parameters:
servletPath - The servletPath of the current request
pathInfo - The pathInfo of the current request
Returns:
the mapping of the FacesServlet in the web.xml configuration file


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.