org.apache.myfaces.tomahawk.application
Class DefaultResourceHandlerSupport

java.lang.Object
  extended by org.apache.myfaces.tomahawk.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: 915763 $ $Date: 2010-02-24 07:24:11 -0500 (Mié, 24 Feb 2010) $
Author:
Leonardo Uribe (latest modification by $Author: bommel $)

Constructor Summary
DefaultResourceHandlerSupport()
           
 
Method Summary
protected static 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(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.
 java.lang.String getMapping()
          Get the mapping used as prefix(/faces) or sufix(.jsf)
 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(javax.faces.context.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

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 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.


calculateFacesServletMapping

protected static 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 © 2010 The Apache Software Foundation. All Rights Reserved.