org.apache.myfaces.renderkit.html.util
Class AddResourceFactory

java.lang.Object
  extended by org.apache.myfaces.renderkit.html.util.AddResourceFactory

public class AddResourceFactory
extends java.lang.Object

This class provides the ability to instantiate AddResource objects. By default, this class will instantiate instances of org.apache.myfaces.component.html.util.DefaultAddResource. However, the context parameter org.apache.myfaces.ADD_RESOURCE_CLASS can specify an alternative implementation of the AddResource interface. The class must have a constructor with a single String argument, representing the context path.

Mostly used to avoid having to include [script src="..."][/script] in the head of the pages before using a component.

Version:
$Revision: 358042 $ $Date: 2005-12-20 17:12:56 +0000 (Tue, 20 Dec 2005) $
Author:
Peter Mahoney, Sylvain Vieujot (latest modification by $Author: mmarinschek $)

Nested Class Summary
static class AddResourceFactory.RequestMapWrapper
           
 
Field Summary
protected static org.apache.commons.logging.Log log
           
 
Constructor Summary
AddResourceFactory()
           
 
Method Summary
protected static boolean checkFilterPattern(org.apache.myfaces.shared_tomahawk.webapp.webxml.FilterMapping filterMapping)
           
static AddResource getInstance(javax.faces.context.FacesContext context)
           
static AddResource getInstance(javax.servlet.http.HttpServletRequest request)
           
(package private) static AddResource getInstance(java.util.Map cacheMap, java.lang.String contextPath, java.lang.String addResourceClassName)
          Internal factory method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Constructor Detail

AddResourceFactory

public AddResourceFactory()
Method Detail

getInstance

static AddResource getInstance(java.util.Map cacheMap,
                               java.lang.String contextPath,
                               java.lang.String addResourceClassName)
Internal factory method.

Return an instance of AddResource keyed by context path, or create one if no such instance already exists. The instance will be cached using the given Map, most likely this will the the request map of your servlet request. Therefore every request uses its own AddResource instance.

Note that this method is package-scope for the purposes of unit-testing only. This method should be treated as private by non-test code.

Parameters:
cacheMap - the map used for caching of the instance. if null, a new instance will be created all the time (for tests)
contextPath - context path of your web-app
addResourceClassName - class name of a class implementing the

getInstance

public static AddResource getInstance(javax.faces.context.FacesContext context)

getInstance

public static AddResource getInstance(javax.servlet.http.HttpServletRequest request)

checkFilterPattern

protected static boolean checkFilterPattern(org.apache.myfaces.shared_tomahawk.webapp.webxml.FilterMapping filterMapping)


Copyright 2006 Apache Software Foundation. All Rights Reserved.