You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by st...@apache.org on 2011/10/20 23:40:30 UTC
svn commit: r1187063 - in
/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler:
./ config/ resource/ webapp/config/ webapp/config/impl/
Author: struberg
Date: Thu Oct 20 21:40:30 2011
New Revision: 1187063
URL: http://svn.apache.org/viewvc?rev=1187063&view=rev
Log:
MFCOMMONS-40 fix checkstyle rules
still not all errors in mf-commons-resourcehandler resolved :(
Modified:
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedDefaultResourceHandlerSupport.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceHandlerImpl.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceImpl.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/GZIPResourceLoader.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/config/MyFacesResourceHandlerConfigParser.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/AliasResourceMetaImpl.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ExternalContextResourceLoader.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceHandlerCache.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceImpl.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceLoaderUtils.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceMetaImpl.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ValueExpressionFilterInputStream.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/WebConfigProviderFactory.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebConfigProviderImpl.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebXmlConfigParser.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_ExternalSpecifications.java
myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_Servlet30Utils.java
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedDefaultResourceHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedDefaultResourceHandlerSupport.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedDefaultResourceHandlerSupport.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedDefaultResourceHandlerSupport.java Thu Oct 20 21:40:30 2011
@@ -52,7 +52,8 @@ public class ExtendedDefaultResourceHand
ExtendedDefaultResourceHandlerSupport.class.getName() + ".CACHED_SERVLET_MAPPING";
/**
- * Enable or disable gzip compressions for resources served by this extended resource handler. By default is disabled (false).
+ * Enable or disable gzip compressions for resources served by this extended resource handler.
+ * By default is disabled (false).
*/
@JSFWebConfigParam(defaultValue="false")
public static final String INIT_PARAM_GZIP_RESOURCES_ENABLED = "org.apache.myfaces.commons.GZIP_RESOURCES_ENABLED";
@@ -69,31 +70,25 @@ public class ExtendedDefaultResourceHand
* disable, the files are compressed when they are served.
*/
@JSFWebConfigParam(defaultValue="true")
- public static final String INIT_PARAM_CACHE_DISK_GZIP_RESOURCES = "org.apache.myfaces.commons.CACHE_DISK_GZIP_RESOURCES";
+ public static final String INIT_PARAM_CACHE_DISK_GZIP_RESOURCES
+ = "org.apache.myfaces.commons.CACHE_DISK_GZIP_RESOURCES";
/**
- * Indicate the prefix that is added to each resource path that is used later to check if the request is a resource request.
+ * 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
*/
@JSFWebConfigParam(defaultValue="/javax.faces.resource")
- public static final String INIT_PARAM_EXTENDED_RESOURCE_IDENTIFIER = "org.apache.myfaces.commons.EXTENDED_RESOURCE_IDENTIFIER";
+ public static final String INIT_PARAM_EXTENDED_RESOURCE_IDENTIFIER
+ = "org.apache.myfaces.commons.EXTENDED_RESOURCE_IDENTIFIER";
private static final String INIT_PARAM_DELEGATE_FACES_SERVLET = "org.apache.myfaces.DELEGATE_FACES_SERVLET";
- private static Class DELEGATE_FACES_SERVLET_INTERFACE_CLASS = null;
-
- static
- {
- try
- {
- DELEGATE_FACES_SERVLET_INTERFACE_CLASS = ClassUtils.classForName("org.apache.myfaces.shared_impl.webapp.webxml.DelegatedFacesServlet");
- }
- catch (ClassNotFoundException e)
- {
- }
- }
+ private static final Class DELEGATE_FACES_SERVLET_INTERFACE_CLASS
+ = ClassUtils.simpleClassForName("org.apache.myfaces.shared_impl.webapp.webxml.DelegatedFacesServlet");
+
/**
* Accept-Encoding HTTP header field.
*/
@@ -324,7 +319,8 @@ public class ExtendedDefaultResourceHand
String delegateFacesServlet = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(),
INIT_PARAM_DELEGATE_FACES_SERVLET);
- for (Map.Entry<String, ? extends ServletRegistration> entry : webRegistration.getServletRegistrations().entrySet())
+ for (Map.Entry<String, ? extends ServletRegistration> entry :
+ webRegistration.getServletRegistrations().entrySet())
{
ServletRegistration registration = entry.getValue();
boolean facesServlet = false;
@@ -343,7 +339,7 @@ public class ExtendedDefaultResourceHand
try
{
Class servletClass = ClassUtils.classForName(registration.getClassName());
- if (DELEGATE_FACES_SERVLET_INTERFACE_CLASS.isAssignableFrom(servletClass));
+ if (DELEGATE_FACES_SERVLET_INTERFACE_CLASS.isAssignableFrom(servletClass))
{
facesServlet = true;
}
@@ -353,7 +349,8 @@ public class ExtendedDefaultResourceHand
Log log = LogFactory.getLog(ExtendedDefaultResourceHandlerSupport.class);
if (log.isTraceEnabled())
{
- log.trace("cannot load servlet class to detect if is a FacesServlet or DelegateFacesServlet", e);
+ log.trace("cannot load servlet class to detect if is a FacesServlet or DelegateFacesServlet"
+ , e);
}
}
}
@@ -362,8 +359,9 @@ public class ExtendedDefaultResourceHand
{
for (String urlPattern : registration.getMappings())
{
- String extension = urlPattern != null && urlPattern.startsWith("*.") ? urlPattern.substring(urlPattern
- .indexOf('.')) : null;
+ String extension = urlPattern != null && urlPattern.startsWith("*.")
+ ? urlPattern.substring(urlPattern.indexOf('.'))
+ : null;
if (extension == null)
{
int index = urlPattern.indexOf("/*");
@@ -405,8 +403,10 @@ public class ExtendedDefaultResourceHand
if (/*!_developmentStage && */isGzipResourcesEnabled() && isCacheDiskGzipResources())
{
_resourceLoaders = new ResourceLoader[] {
- new GZIPResourceLoader(new ExtendedResourceLoaderWrapper(new ExternalContextResourceLoader("/resources")), this),
- new GZIPResourceLoader(new ExtendedResourceLoaderWrapper(new ClassLoaderResourceLoader("META-INF/resources")), this)
+ new GZIPResourceLoader(new ExtendedResourceLoaderWrapper(
+ new ExternalContextResourceLoader("/resources")), this),
+ new GZIPResourceLoader(new ExtendedResourceLoaderWrapper(
+ new ClassLoaderResourceLoader("META-INF/resources")), this)
};
}
else
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceHandlerImpl.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceHandlerImpl.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceHandlerImpl.java Thu Oct 20 21:40:30 2011
@@ -145,19 +145,24 @@ public class ExtendedResourceHandlerImpl
//resource = new ResourceImpl(resourceValue.getResourceMeta(), resourceValue.getResourceLoader(),
// getResourceHandlerSupport(), contentType);
- resource = new ExtendedResourceImpl((ExtendedResourceMeta) resourceValue.getResourceMeta(), resourceValue.getResourceLoader(),
- getResourceHandlerSupport(), contentType, localePrefix, redirectedLibraryName.equals(expectedLibraryName) ? null : expectedLibraryName);
+ resource = new ExtendedResourceImpl((ExtendedResourceMeta) resourceValue.getResourceMeta(),
+ resourceValue.getResourceLoader(),
+ getResourceHandlerSupport(),
+ contentType, localePrefix,
+ redirectedLibraryName.equals(expectedLibraryName) ? null : expectedLibraryName);
}
else
{
for (ResourceLoader loader : getResourceHandlerSupport().getResourceLoaders())
{
- ResourceMeta resourceMeta = deriveResourceMeta(loader, resourceName, redirectedLibraryName, localePrefix);
+ ResourceMeta resourceMeta = deriveResourceMeta(loader, resourceName,
+ redirectedLibraryName, localePrefix);
if (resourceMeta != null)
{
//resource = new ResourceImpl(resourceMeta, loader, getResourceHandlerSupport(), contentType);
- resource = new ExtendedResourceImpl((ExtendedResourceMeta) resourceMeta, loader, getResourceHandlerSupport(), contentType, localePrefix,
+ resource = new ExtendedResourceImpl((ExtendedResourceMeta) resourceMeta, loader,
+ getResourceHandlerSupport(), contentType, localePrefix,
redirectedLibraryName.equals(expectedLibraryName) ? null : expectedLibraryName);
// cache it
@@ -320,22 +325,9 @@ public class ExtendedResourceHandlerImpl
@Override
public void handleResourceRequest(FacesContext facesContext) throws IOException
{
- // Only if filter is on
- //if (!isFilterOn())
- //{
- // super.handleResourceRequest(facesContext);
- //}
-
- // And this is a request handled from the filter first!
- //if (!facesContext.getAttributes().containsKey(ResourceHandlerFilter.RESOURCE_HANDLER_FILTER_REQUEST))
- //{
- // super.handleResourceRequest(facesContext);
- //}
-
try
{
- String resourceBasePath = getResourceHandlerSupport()
- .calculateResourceBasePath(facesContext);
+ String resourceBasePath = getResourceHandlerSupport().calculateResourceBasePath(facesContext);
if (resourceBasePath == null)
{
@@ -369,7 +361,7 @@ public class ExtendedResourceHandlerImpl
return;
}
- String resourceName = null;
+ String resourceName;
String libraryName = null;
String requestedLocalePrefix = null;
if (resourceBasePath.startsWith(getResourceHandlerSupport().getResourceIdentifier()))
@@ -418,7 +410,8 @@ public class ExtendedResourceHandlerImpl
super.handleResourceRequest(facesContext);
return;
}
- else if (libraryName != null && getResourceHandlerSupport().getMyFacesResourcesConfig().getLibrary(libraryName) == null)
+ else if (libraryName != null &&
+ getResourceHandlerSupport().getMyFacesResourcesConfig().getLibrary(libraryName) == null)
{
super.handleResourceRequest(facesContext);
return;
@@ -429,33 +422,20 @@ public class ExtendedResourceHandlerImpl
facesContext.getAttributes().put(RESOURCE_LOCALE, requestedLocalePrefix);
}
- Resource resource = null;
- //if (libraryName != null)
- //{
- //log.info("libraryName=" + libraryName);
- resource = facesContext.getApplication().getResourceHandler().createResource(resourceName, libraryName);
- //}
- //else
- //{
- // resource = facesContext.getApplication().getResourceHandler().createResource(resourceName);
- //}
-
+ Resource resource
+ = facesContext.getApplication().getResourceHandler().createResource(resourceName, libraryName);
if (resource == null)
{
httpServletResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
-
if (!resource.userAgentNeedsUpdate(facesContext))
{
httpServletResponse.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
return;
}
-
httpServletResponse.setContentType(_getContentType(resource, facesContext.getExternalContext()));
-
Map<String, String> headers = resource.getResponseHeaders();
-
for (Map.Entry<String, String> entry : headers.entrySet())
{
httpServletResponse.setHeader(entry.getKey(), entry.getValue());
@@ -502,7 +482,6 @@ public class ExtendedResourceHandlerImpl
InputStream in = resource.getInputStream();
OutputStream out = httpServletResponse.getOutputStream();
byte[] buffer = new byte[_BUFFER_SIZE];
-
try
{
int count = pipeBytes(in, out, buffer);
@@ -526,9 +505,11 @@ public class ExtendedResourceHandlerImpl
{
//TODO: Log using a localized message (which one?)
if (log.isLoggable(Level.SEVERE))
+ {
log.severe("Error trying to load resource " + resourceName
+ " with library " + libraryName + " :"
+ e.getMessage());
+ }
httpServletResponse.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
}
@@ -713,7 +694,9 @@ public class ExtendedResourceHandlerImpl
private ResourceHandlerCache getResourceLoaderCache()
{
if (_resourceHandlerCache == null)
+ {
_resourceHandlerCache = new ResourceHandlerCache();
+ }
return _resourceHandlerCache;
}
@@ -763,4 +746,4 @@ public class ExtendedResourceHandlerImpl
{
return _delegate;
}
-}
\ No newline at end of file
+}
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceImpl.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceImpl.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceImpl.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/ExtendedResourceImpl.java Thu Oct 20 21:40:30 2011
@@ -30,13 +30,11 @@ import javax.el.ELResolver;
import javax.el.FunctionMapper;
import javax.el.ValueExpression;
import javax.el.VariableMapper;
-import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
import org.apache.myfaces.commons.resourcehandler.config.element.Library;
import org.apache.myfaces.commons.resourcehandler.resource.ResourceImpl;
import org.apache.myfaces.commons.resourcehandler.resource.ResourceLoader;
-import org.apache.myfaces.commons.resourcehandler.resource.ValueExpressionFilterInputStream;
/**
*
@@ -287,9 +285,12 @@ public class ExtendedResourceImpl extend
{
this.delegate = delegate;
map = new HashMap<String, ValueExpression>(4,1);
- map.put("localePrefix", context.getApplication().getExpressionFactory().createValueExpression(resource.getLocalePrefix(), String.class));
- map.put("libraryName", context.getApplication().getExpressionFactory().createValueExpression(resource.getLibraryName(), String.class));
- map.put("resourceName", context.getApplication().getExpressionFactory().createValueExpression(resource.getResourceName(), String.class));
+ map.put("localePrefix", context.getApplication().getExpressionFactory().
+ createValueExpression(resource.getLocalePrefix(), String.class));
+ map.put("libraryName", context.getApplication().getExpressionFactory().
+ createValueExpression(resource.getLibraryName(), String.class));
+ map.put("resourceName", context.getApplication().getExpressionFactory().
+ createValueExpression(resource.getResourceName(), String.class));
map.put("mapping", context.getApplication().getExpressionFactory().createValueExpression(
resource.getExtendedDefaultResourceHandlerSupport().getMapping(), String.class));
map.put("extensionMapping", context.getApplication().getExpressionFactory().createValueExpression(
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/GZIPResourceLoader.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/GZIPResourceLoader.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/GZIPResourceLoader.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/GZIPResourceLoader.java Thu Oct 20 21:40:30 2011
@@ -72,7 +72,8 @@ public class GZIPResourceLoader extends
private final ExtendedDefaultResourceHandlerSupport _extendedDefaultResourceHandlerSupport;
- public GZIPResourceLoader(ResourceLoader delegate, ExtendedDefaultResourceHandlerSupport extendedDefaultResourceHandlerSupport)
+ public GZIPResourceLoader(ResourceLoader delegate,
+ ExtendedDefaultResourceHandlerSupport extendedDefaultResourceHandlerSupport)
{
this.delegate = delegate;
_extendedDefaultResourceHandlerSupport = extendedDefaultResourceHandlerSupport;
@@ -127,7 +128,8 @@ public class GZIPResourceLoader extends
{
FacesContext facesContext = FacesContext.getCurrentInstance();
- if (!_extendedDefaultResourceHandlerSupport.isCompressable(resourceMeta) || !_extendedDefaultResourceHandlerSupport.userAgentSupportsCompression(facesContext))
+ if (!_extendedDefaultResourceHandlerSupport.isCompressable(resourceMeta) ||
+ !_extendedDefaultResourceHandlerSupport.userAgentSupportsCompression(facesContext))
{
return super.getResourceURL(resourceMeta);
}
@@ -156,7 +158,8 @@ public class GZIPResourceLoader extends
{
FacesContext facesContext = FacesContext.getCurrentInstance();
- if (!_extendedDefaultResourceHandlerSupport.isCompressable(resourceMeta) || !_extendedDefaultResourceHandlerSupport.userAgentSupportsCompression(facesContext))
+ if (!_extendedDefaultResourceHandlerSupport.isCompressable(resourceMeta) ||
+ !_extendedDefaultResourceHandlerSupport.userAgentSupportsCompression(facesContext))
{
return super.getResourceInputStream(resourceMeta);
}
@@ -317,7 +320,8 @@ public class GZIPResourceLoader extends
}
}
- public static class FileProducer {
+ public static class FileProducer
+ {
public volatile boolean created = false;
@@ -331,7 +335,8 @@ public class GZIPResourceLoader extends
return created;
}
- public synchronized void createFile(FacesContext facesContext, ResourceMeta resourceMeta, File file, GZIPResourceLoader loader)
+ public synchronized void createFile(FacesContext facesContext, ResourceMeta resourceMeta,
+ File file, GZIPResourceLoader loader)
{
if (!created)
{
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/config/MyFacesResourceHandlerConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/config/MyFacesResourceHandlerConfigParser.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/config/MyFacesResourceHandlerConfigParser.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/config/MyFacesResourceHandlerConfigParser.java Thu Oct 20 21:40:30 2011
@@ -55,19 +55,26 @@ public class MyFacesResourceHandlerConfi
{
/**
- * This param allow to override the default strategy to locate myfaces-resources-config.xml files, that will be parsed later. In this way
+ * This param allow to override the default strategy to locate myfaces-resources-config.xml files,
+ * that will be parsed later. In this way
* it is possible to include new source locations or handle cases like OSGi specific setup.
*/
@JSFWebConfigParam
- public static final String INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER = "org.apache.myfaces.commons.EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER";
- public static final String INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER_DEFAULT = DefaultMyFacesResourceHandlerUrlProvider.class.getName();
+ public static final String INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER
+ = "org.apache.myfaces.commons.EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER";
+
+ public static final String INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER_DEFAULT
+ = DefaultMyFacesResourceHandlerUrlProvider.class.getName();
public MyFacesResourcesConfig parse(FacesContext facesContext)
{
- String resourceHandlerUrlProviderClassName = WebConfigParamUtils.getStringInitParameter(facesContext.getExternalContext(),
- INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER, INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER_DEFAULT);
+ String resourceHandlerUrlProviderClassName
+ = WebConfigParamUtils.getStringInitParameter(facesContext.getExternalContext(),
+ INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER,
+ INIT_PARAM_EXTENDED_RESOURCE_HANDLER_CONFIG_URL_PROVIDER_DEFAULT);
- MyFacesResourceHandlerUrlProvider urlProvider = (MyFacesResourceHandlerUrlProvider) ClassUtils.newInstance(resourceHandlerUrlProviderClassName);
+ MyFacesResourceHandlerUrlProvider urlProvider
+ = (MyFacesResourceHandlerUrlProvider) ClassUtils.newInstance(resourceHandlerUrlProviderClassName);
List<URL> configUrls = new ArrayList<URL>();
@@ -105,7 +112,8 @@ public class MyFacesResourceHandlerConfi
configList.add(mrc);
}
}
- catch (IOException e) {
+ catch (IOException e)
+ {
throw new FacesException("Cannot parse file "+url);
}
}
@@ -151,11 +159,14 @@ public class MyFacesResourceHandlerConfi
finally
{
if (is != null)
+ {
is.close();
+ }
}
}
- private static final SAXParser createSAXParser(LibraryHandler handler, ExternalContext externalContext, boolean schemaValidating) throws SAXException,
+ private static final SAXParser createSAXParser(LibraryHandler handler, ExternalContext externalContext,
+ boolean schemaValidating) throws SAXException,
ParserConfigurationException
{
SAXParserFactory factory = SAXParserFactory.newInstance();
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/AliasResourceMetaImpl.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/AliasResourceMetaImpl.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/AliasResourceMetaImpl.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/AliasResourceMetaImpl.java Thu Oct 20 21:40:30 2011
@@ -61,28 +61,39 @@ public class AliasResourceMetaImpl exten
}
if (getLibraryName() != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(getLibraryName());
firstSlashAdded = true;
}
if (getLibraryVersion() != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(getLibraryVersion());
firstSlashAdded = true;
}
if (getRealResourceName() != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(getRealResourceName());
firstSlashAdded = true;
}
if (getResourceVersion() != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(getResourceVersion());
- builder.append(
- getRealResourceName().substring(getRealResourceName().lastIndexOf('.')));
+ builder.append(getRealResourceName().substring(getRealResourceName().lastIndexOf('.')));
firstSlashAdded = true;
}
return builder.toString();
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ExternalContextResourceLoader.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ExternalContextResourceLoader.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ExternalContextResourceLoader.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ExternalContextResourceLoader.java Thu Oct 20 21:40:30 2011
@@ -39,14 +39,14 @@ public class ExternalContextResourceLoad
*
* Used on getLibraryVersion to filter resource directories
**/
- protected static Pattern VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*/");
+ protected static final Pattern VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*/");
/**
* It checks version like this: /1.js, /1_0.js, /1_0_0.js, /100_100.js
*
* Used on getResourceVersion to filter resources
**/
- protected static Pattern RESOURCE_VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*\\..*");
+ protected static final Pattern RESOURCE_VERSION_CHECKER = Pattern.compile("/\\p{Digit}+(_\\p{Digit}*)*\\..*");
public ExternalContextResourceLoader(String prefix)
{
@@ -64,7 +64,9 @@ public class ExternalContextResourceLoad
String resourceVersion = null;
Set<String> resourcePaths = this.getResourcePaths(path);
if (getPrefix() != null)
+ {
path = getPrefix() + '/' + path;
+ }
if (null != resourcePaths && !resourcePaths.isEmpty())
{
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceHandlerCache.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceHandlerCache.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceHandlerCache.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceHandlerCache.java Thu Oct 20 21:40:30 2011
@@ -40,22 +40,30 @@ public class ResourceHandlerCache
private Map<ResourceKey, ResourceValue> _resourceCacheMap = null;
@JSFWebConfigParam(defaultValue = "500", since = "2.0.2")
- private static final String RESOURCE_HANDLER_CACHE_SIZE_ATTRIBUTE = "org.apache.myfaces.RESOURCE_HANDLER_CACHE_SIZE";
+ private static final String RESOURCE_HANDLER_CACHE_SIZE_ATTRIBUTE
+ = "org.apache.myfaces.RESOURCE_HANDLER_CACHE_SIZE";
+
private static final int RESOURCE_HANDLER_CACHE_DEFAULT_SIZE = 500;
@JSFWebConfigParam(defaultValue = "true", since = "2.0.2")
- private static final String RESOURCE_HANDLER_CACHE_ENABLED_ATTRIBUTE = "org.apache.myfaces.RESOURCE_HANDLER_CACHE_ENABLED";
+ private static final String RESOURCE_HANDLER_CACHE_ENABLED_ATTRIBUTE
+ = "org.apache.myfaces.RESOURCE_HANDLER_CACHE_ENABLED";
+
private static final boolean RESOURCE_HANDLER_CACHE_ENABLED_DEFAULT = true;
public ResourceValue getResource(String resourceName, String libraryName,
String contentType, String localePrefix)
{
if (!isResourceCachingEnabled() || _resourceCacheMap == null)
+ {
return null;
+ }
if (log.isLoggable(Level.FINE))
+ {
log.log(Level.FINE, "Attemping to get resource from cache for "
+ resourceName);
+ }
ResourceKey key = new ResourceKey(resourceName, libraryName, contentType, localePrefix);
@@ -65,7 +73,9 @@ public class ResourceHandlerCache
public boolean containsResource(String resourceName, String libraryName, String contentType, String localePrefix)
{
if (!isResourceCachingEnabled() || _resourceCacheMap == null)
+ {
return false;
+ }
ResourceKey key = new ResourceKey(resourceName, libraryName, contentType, localePrefix);
return _resourceCacheMap.containsKey(key);
@@ -75,16 +85,22 @@ public class ResourceHandlerCache
String contentType, String localePrefix, ResourceMeta resource, ResourceLoader loader)
{
if (!isResourceCachingEnabled())
+ {
return;
+ }
if (log.isLoggable(Level.FINE))
+ {
log.log(Level.FINE, "Attemping to put resource to cache for "
+ resourceName);
+ }
if (_resourceCacheMap == null)
{
if (log.isLoggable(Level.FINE))
+ {
log.log(Level.FINE, "Initializing resource cache map");
+ }
_resourceCacheMap = Collections
.synchronizedMap(new _ResourceMap<ResourceKey, ResourceValue>(
getMaxSize()));
@@ -108,7 +124,9 @@ public class ResourceHandlerCache
ExternalContext externalContext = facesContext.getExternalContext();
if (externalContext == null)
+ {
return false; //don't cache right now, but don't disable it yet either
+ }
//if in production, make sure that the cache is not explicitly disabled via context param
_resourceCacheEnabled = WebConfigParamUtils.getBooleanInitParameter(externalContext,
@@ -237,4 +255,4 @@ public class ResourceHandlerCache
return size() > maxCapacity;
}
}
-}
\ No newline at end of file
+}
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceImpl.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceImpl.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceImpl.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceImpl.java Thu Oct 20 21:40:30 2011
@@ -20,25 +20,14 @@ package org.apache.myfaces.commons.resou
import java.io.IOException;
import java.io.InputStream;
-import java.io.PushbackInputStream;
import java.net.URL;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.el.ELContext;
-import javax.el.ELException;
-import javax.el.ValueExpression;
import javax.faces.application.ProjectStage;
import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
-import javax.faces.event.ExceptionQueuedEvent;
-import javax.faces.event.ExceptionQueuedEventContext;
/**
* Default implementation for resources
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceLoaderUtils.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceLoaderUtils.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceLoaderUtils.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceLoaderUtils.java Thu Oct 20 21:40:30 2011
@@ -65,7 +65,7 @@ public class ResourceLoaderUtils
}
catch (ParseException e)
{
- ;
+ // all fine
}
}
if (date == null)
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceMetaImpl.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceMetaImpl.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceMetaImpl.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ResourceMetaImpl.java Thu Oct 20 21:40:30 2011
@@ -80,28 +80,39 @@ public class ResourceMetaImpl extends Re
}
if (_libraryName != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(_libraryName);
firstSlashAdded = true;
}
if (_libraryVersion != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(_libraryVersion);
firstSlashAdded = true;
}
if (_resourceName != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(_resourceName);
firstSlashAdded = true;
}
if (_resourceVersion != null)
{
- if (firstSlashAdded) builder.append('/');
+ if (firstSlashAdded)
+ {
+ builder.append('/');
+ }
builder.append(_resourceVersion);
- builder.append(
- _resourceName.substring(_resourceName.lastIndexOf('.')));
+ builder.append(_resourceName.substring(_resourceName.lastIndexOf('.')));
firstSlashAdded = true;
}
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ValueExpressionFilterInputStream.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ValueExpressionFilterInputStream.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ValueExpressionFilterInputStream.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/resource/ValueExpressionFilterInputStream.java Thu Oct 20 21:40:30 2011
@@ -50,12 +50,18 @@ public class ValueExpressionFilterInputS
{
int c1 = delegate.read();
- if (c1 == -1) return -1;
+ if (c1 == -1)
+ {
+ return -1;
+ }
if ( ((char)c1) == '#')
{
int c2 = delegate.read();
- if (c2 == -1) return -1;
+ if (c2 == -1)
+ {
+ return -1;
+ }
if (((char)c2) == '{')
{
//It is a value expression. We need
@@ -108,7 +114,10 @@ public class ValueExpressionFilterInputS
Logger log = Logger.getLogger(ResourceImpl.class.getName());
if (log.isLoggable(Level.SEVERE))
- log.severe("Cannot evaluate EL expression "+convertToExpression(expressionList)+ " in resource " + (libraryName == null ? "" : libraryName)+":"+resourceName);
+ {
+ log.severe("Cannot evaluate EL expression "+convertToExpression(expressionList)
+ + " in resource " + (libraryName == null ? "" : libraryName)+":"+resourceName);
+ }
delegate.unread(c3);
for (int i = expressionList.size()-1; i >= 0; i--)
@@ -146,4 +155,4 @@ public class ValueExpressionFilterInputS
}
return String.valueOf(exprArray);
}
-}
\ No newline at end of file
+}
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/WebConfigProviderFactory.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/WebConfigProviderFactory.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/WebConfigProviderFactory.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/WebConfigProviderFactory.java Thu Oct 20 21:40:30 2011
@@ -35,7 +35,8 @@ public abstract class WebConfigProviderF
public static WebConfigProviderFactory getFacesConfigResourceProviderFactory(FacesContext ctx)
{
- WebConfigProviderFactory instance = (WebConfigProviderFactory) ctx.getExternalContext().getApplicationMap().get(FACTORY_KEY);
+ WebConfigProviderFactory instance
+ = (WebConfigProviderFactory) ctx.getExternalContext().getApplicationMap().get(FACTORY_KEY);
if (instance != null)
{
return instance;
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebConfigProviderImpl.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebConfigProviderImpl.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebConfigProviderImpl.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebConfigProviderImpl.java Thu Oct 20 21:40:30 2011
@@ -59,7 +59,8 @@ public class WebConfigProviderImpl exten
public WebRegistration getWebRegistration(FacesContext context)
{
- WebRegistration webConfig = (WebRegistration)context.getExternalContext().getApplicationMap().get(WEB_REGISTRATION_KEY);
+ WebRegistration webConfig
+ = (WebRegistration)context.getExternalContext().getApplicationMap().get(WEB_REGISTRATION_KEY);
if (webConfig == null)
{
init(context);
@@ -72,17 +73,20 @@ public class WebConfigProviderImpl exten
{
if (servlet30Mode == null)
{
- servlet30Mode = (context.getExternalContext().getContext() instanceof ServletContext && _ExternalSpecifications.isServlet30Available());
+ servlet30Mode = (context.getExternalContext().getContext() instanceof ServletContext
+ && _ExternalSpecifications.isServlet30Available());
}
if (servlet30Mode)
{
ServletContext servletContext = (ServletContext) context.getExternalContext().getContext();
- context.getExternalContext().getApplicationMap().put(WEB_REGISTRATION_KEY, _Servlet30Utils.getWebRegistrationFromServlet30Api(servletContext));
+ context.getExternalContext().getApplicationMap().put(WEB_REGISTRATION_KEY,
+ _Servlet30Utils.getWebRegistrationFromServlet30Api(servletContext));
}
else
{
//Load the information parsing web.xml
- context.getExternalContext().getApplicationMap().put(WEB_REGISTRATION_KEY, WebXmlConfigParser.getWebRegistrationFromParsedWebXml(context));
+ context.getExternalContext().getApplicationMap().put(WEB_REGISTRATION_KEY,
+ WebXmlConfigParser.getWebRegistrationFromParsedWebXml(context));
}
if (!context.isProjectStage(ProjectStage.Production))
{
@@ -97,7 +101,8 @@ public class WebConfigProviderImpl exten
{
if (servlet30Mode == null)
{
- servlet30Mode = (context.getExternalContext().getContext() instanceof ServletContext && _ExternalSpecifications.isServlet30Available());
+ servlet30Mode = (context.getExternalContext().getContext() instanceof ServletContext
+ && _ExternalSpecifications.isServlet30Available());
}
if (!servlet30Mode && !context.isProjectStage(ProjectStage.Production))
{
@@ -110,9 +115,11 @@ public class WebConfigProviderImpl exten
private boolean isOld(ExternalContext context)
{
- if (refreshPeriod > 0) {
+ if (refreshPeriod > 0)
+ {
long ttl = this.parsingTime + refreshPeriod;
- if (System.currentTimeMillis() > ttl) {
+ if (System.currentTimeMillis() > ttl)
+ {
long lastModified = getWebXmlLastModified(context);
return lastModified == 0 || lastModified > ttl;
}
@@ -123,11 +130,16 @@ public class WebConfigProviderImpl exten
private static long getWebXmlLastModified(ExternalContext context)
{
- try {
+ try
+ {
URL url = context.getResource(WEB_XML_PATH);
if (url != null)
+ {
return url.openConnection().getLastModified();
- } catch (IOException e) {
+ }
+ }
+ catch (IOException e)
+ {
Log log = LogFactory.getLog(WebConfigProviderFactory.class);
if (log.isErrorEnabled())
{
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebXmlConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebXmlConfigParser.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebXmlConfigParser.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/WebXmlConfigParser.java Thu Oct 20 21:40:30 2011
@@ -67,7 +67,8 @@ public class WebXmlConfigParser
return null;
}
}
- catch (IOException e) {
+ catch (IOException e)
+ {
throw new FacesException("Cannot parse /WEB-INF/web.xml file ");
}
}
@@ -105,11 +106,14 @@ public class WebXmlConfigParser
finally
{
if (is != null)
+ {
is.close();
+ }
}
}
- private static final SAXParser createSAXParser(WebConfigHandler handler, ExternalContext externalContext, boolean schemaValidating) throws SAXException,
+ private static final SAXParser createSAXParser(WebConfigHandler handler, ExternalContext externalContext,
+ boolean schemaValidating) throws SAXException,
ParserConfigurationException
{
SAXParserFactory factory = SAXParserFactory.newInstance();
@@ -203,7 +207,8 @@ public class WebXmlConfigParser
if ("servlet".equals(localName))
{
- ServletRegistrationImpl sr = (ServletRegistrationImpl) this.config.getServletRegistration(this.servletName);
+ ServletRegistrationImpl sr
+ = (ServletRegistrationImpl) this.config.getServletRegistration(this.servletName);
if (sr == null)
{
sr = new ServletRegistrationImpl(this.servletName, this.servletClassName);
@@ -224,7 +229,8 @@ public class WebXmlConfigParser
}
else if ("filter".equals(localName))
{
- FilterRegistrationImpl sr = (FilterRegistrationImpl) this.config.getFilterRegistration(this.filterName);
+ FilterRegistrationImpl sr
+ = (FilterRegistrationImpl) this.config.getFilterRegistration(this.filterName);
if (sr == null)
{
sr = new FilterRegistrationImpl(this.filterName, this.filterClassName);
@@ -245,7 +251,8 @@ public class WebXmlConfigParser
}
else if ("servlet-mapping".equals(localName))
{
- ServletRegistrationImpl sr = (ServletRegistrationImpl) this.config.getServletRegistration(this.servletName);
+ ServletRegistrationImpl sr
+ = (ServletRegistrationImpl) this.config.getServletRegistration(this.servletName);
if (sr == null)
{
sr = new ServletRegistrationImpl(this.servletName);
@@ -258,7 +265,8 @@ public class WebXmlConfigParser
}
else if ("filter-mapping".equals(localName))
{
- FilterRegistrationImpl sr = (FilterRegistrationImpl) this.config.getFilterRegistration(this.filterName);
+ FilterRegistrationImpl sr
+ = (FilterRegistrationImpl) this.config.getFilterRegistration(this.filterName);
if (sr == null)
{
sr = new FilterRegistrationImpl(this.filterName);
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_ExternalSpecifications.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_ExternalSpecifications.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_ExternalSpecifications.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_ExternalSpecifications.java Thu Oct 20 21:40:30 2011
@@ -58,7 +58,8 @@ final class _ExternalSpecifications
servlet30Available = Boolean.FALSE;
}
- log.info("MyFaces commons ResourceHandler Servlet 3.0 container support " + (servlet30Available ? "enabled" : "disabled"));
+ log.info("MyFaces commons ResourceHandler Servlet 3.0 container support "
+ + (servlet30Available ? "enabled" : "disabled"));
}
return servlet30Available;
}
Modified: myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_Servlet30Utils.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_Servlet30Utils.java?rev=1187063&r1=1187062&r2=1187063&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_Servlet30Utils.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/src/main/java/org/apache/myfaces/commons/resourcehandler/webapp/config/impl/_Servlet30Utils.java Thu Oct 20 21:40:30 2011
@@ -79,8 +79,10 @@ final class _Servlet30Utils
{
//look for prefix mapping
String prefix;
- String extension = urlPattern != null && urlPattern.startsWith("*.") ? urlPattern.substring(urlPattern
- .indexOf('.')) : null;
+ String extension = urlPattern != null && urlPattern.startsWith("*.")
+ ? urlPattern.substring(urlPattern.indexOf('.'))
+ : null;
+
if (extension == null)
{
int index = urlPattern.indexOf("/*");