You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2015/04/01 23:04:06 UTC
svn commit: r1670768 - in /myfaces/shared/trunk/core: ./
src/main/java/org/apache/myfaces/shared/renderkit/html/
src/main/java/org/apache/myfaces/shared/resource/
Author: lu4242
Date: Wed Apr 1 21:04:06 2015
New Revision: 1670768
URL: http://svn.apache.org/r1670768
Log:
update shared for 2.2.8 release
Modified:
myfaces/shared/trunk/core/pom.xml
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ResourceHandlerCache.java
Modified: myfaces/shared/trunk/core/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/pom.xml?rev=1670768&r1=1670767&r2=1670768&view=diff
==============================================================================
--- myfaces/shared/trunk/core/pom.xml (original)
+++ myfaces/shared/trunk/core/pom.xml Wed Apr 1 21:04:06 2015
@@ -143,7 +143,7 @@
<profile>
<id>synch-myfaces-impl-shared</id>
<properties>
- <myfaces.impl.shared.version>2.2.7-SNAPSHOT</myfaces.impl.shared.version>
+ <myfaces.impl.shared.version>2.2.8-SNAPSHOT</myfaces.impl.shared.version>
</properties>
<activation>
<property>
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java?rev=1670768&r1=1670767&r2=1670768&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java Wed Apr 1 21:04:06 2015
@@ -61,11 +61,11 @@ public class HtmlButtonRendererBase
//super.decode must not be called, because value is handled here
boolean disabled = isDisabled(facesContext, uiComponent);
- if (!isReset(uiComponent) && isSubmitted(facesContext, uiComponent) &&
- !disabled)
+ // MYFACES-3960 Decode, decode client behavior and queue action event at the end
+ boolean activateActionEvent = !isReset(uiComponent) && isSubmitted(facesContext, uiComponent) &&
+ !disabled;
+ if (activateActionEvent)
{
- uiComponent.queueEvent(new ActionEvent(uiComponent));
-
org.apache.myfaces.shared.renderkit.RendererUtils.initPartialValidationAndModelUpdate(
uiComponent, facesContext);
}
@@ -75,6 +75,11 @@ public class HtmlButtonRendererBase
{
HtmlRendererUtils.decodeClientBehaviors(facesContext, uiComponent);
}
+
+ if (activateActionEvent)
+ {
+ uiComponent.queueEvent(new ActionEvent(uiComponent));
+ }
}
private static boolean isReset(UIComponent uiComponent)
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java?rev=1670768&r1=1670767&r2=1670768&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java Wed Apr 1 21:04:06 2015
@@ -79,15 +79,16 @@ public abstract class HtmlLinkRendererBa
String clientId = component.getClientId(facesContext);
FormInfo formInfo = findNestingForm(component, facesContext);
boolean disabled = HtmlRendererUtils.isDisabled(component);
+ // MYFACES-3960 Decode, decode client behavior and queue action event at the end
+ boolean activateActionEvent = false;
if (formInfo != null && !disabled)
{
String reqValue = (String) facesContext.getExternalContext().getRequestParameterMap().get(
HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo, facesContext));
- if (reqValue != null && reqValue.equals(clientId)
- || HtmlRendererUtils.isPartialOrBehaviorSubmit(facesContext, clientId))
+ activateActionEvent = reqValue != null && reqValue.equals(clientId)
+ || HtmlRendererUtils.isPartialOrBehaviorSubmit(facesContext, clientId);
+ if (activateActionEvent)
{
- component.queueEvent(new ActionEvent(component));
-
RendererUtils.initPartialValidationAndModelUpdate(component, facesContext);
}
}
@@ -96,6 +97,10 @@ public abstract class HtmlLinkRendererBa
{
HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
}
+ if (activateActionEvent)
+ {
+ component.queueEvent(new ActionEvent(component));
+ }
}
else if (component instanceof UIOutput)
{
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ResourceHandlerCache.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ResourceHandlerCache.java?rev=1670768&r1=1670767&r2=1670768&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ResourceHandlerCache.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ResourceHandlerCache.java Wed Apr 1 21:04:06 2015
@@ -39,6 +39,8 @@ public class ResourceHandlerCache
private volatile ConcurrentLRUCache<Object, ResourceValue> _viewResourceCacheMap = null;
+ private volatile ConcurrentLRUCache<Object, Boolean> _libraryExistsCacheMap = null;
+
/**
* Controls the size of the cache used to check if a resource exists or not.
*
@@ -305,6 +307,76 @@ public class ResourceHandlerCache
_viewResourceCacheMap.put(new ResourceKey(resourceName, null,
contentType, localePrefix, contractName), new ResourceValue(resource, loader, info));
}
+
+ public Boolean libraryExists(String libraryName)
+ {
+ if (!isResourceCachingEnabled() || _libraryExistsCacheMap == null)
+ {
+ return null;
+ }
+
+ if (log.isLoggable(Level.FINE))
+ {
+ log.log(Level.FINE, "Attemping to get libraryExists from cache for "
+ + libraryName);
+ }
+
+ return _libraryExistsCacheMap.get(libraryName);
+ }
+
+ public void confirmLibraryExists(String libraryName)
+ {
+ if (!isResourceCachingEnabled())
+ {
+ return;
+ }
+
+ if (log.isLoggable(Level.FINE))
+ {
+ log.log(Level.FINE, "Attemping to set confirmLibraryExists on cache "
+ + libraryName);
+ }
+
+ if (_libraryExistsCacheMap == null)
+ {
+ if (log.isLoggable(Level.FINE))
+ {
+ log.log(Level.FINE, "Initializing resource cache map");
+ }
+ int maxSize = getMaxSize()/10;
+ _libraryExistsCacheMap = new ConcurrentLRUCache<Object, Boolean>(
+ (maxSize * 4 + 3) / 3, maxSize);
+ }
+
+ _libraryExistsCacheMap.put(libraryName, Boolean.TRUE);
+ }
+
+ public void confirmLibraryNotExists(String libraryName)
+ {
+ if (!isResourceCachingEnabled())
+ {
+ return;
+ }
+
+ if (log.isLoggable(Level.FINE))
+ {
+ log.log(Level.FINE, "Attemping to set confirmLibraryExists on cache "
+ + libraryName);
+ }
+
+ if (_libraryExistsCacheMap == null)
+ {
+ if (log.isLoggable(Level.FINE))
+ {
+ log.log(Level.FINE, "Initializing resource cache map");
+ }
+ int maxSize = getMaxSize()/5;
+ _libraryExistsCacheMap = new ConcurrentLRUCache<Object, Boolean>(
+ (maxSize * 4 + 3) / 3, maxSize);
+ }
+
+ _libraryExistsCacheMap.put(libraryName, Boolean.FALSE);
+ }
private boolean isResourceCachingEnabled()
{