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 2014/01/07 21:38:57 UTC
svn commit: r1556349 [1/2] - in /myfaces/shared/trunk/core/src/main:
java/org/apache/myfaces/shared/application/
java/org/apache/myfaces/shared/config/
java/org/apache/myfaces/shared/context/
java/org/apache/myfaces/shared/context/flash/ java/org/apach...
Author: lu4242
Date: Tue Jan 7 20:38:56 2014
New Revision: 1556349
URL: http://svn.apache.org/r1556349
Log:
synch shared
Added:
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/SubKeyMap.java
Modified:
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/AjaxExceptionHandlerImpl.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/SwitchAjaxExceptionHandlerWrapperImpl.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/flash/FlashImpl.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java
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/HtmlCheckboxRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.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/renderkit/html/HtmlMessageRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSecretRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlSelectableRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTableRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlTextareaRendererBase.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/HTMLEncoder.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/JavascriptUtils.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/util/OutcomeTargetUtils.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/BaseResourceHandlerSupport.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ResourceLoader.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/resource/ValueExpressionFilterInputStream.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/FastWriter.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/util/RendererUtils.java
myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/view/JspViewDeclarationLanguageBase.java
myfaces/shared/trunk/core/src/main/resources/META-INF/myfaces-metadata.xml
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/application/DefaultViewHandlerSupport.java Tue Jan 7 20:38:56 2014
@@ -126,7 +126,7 @@ public class DefaultViewHandlerSupport i
throw new InvalidViewIdException();
}
}
- else if (viewId != null && mapping.getUrlPattern().startsWith(viewId))
+ else if (mapping.getUrlPattern().startsWith(viewId))
{
throw new InvalidViewIdException(viewId);
}
@@ -161,7 +161,7 @@ public class DefaultViewHandlerSupport i
// considered invalid, because jsp vdl will use RequestDispatcher and cause
// a loop that ends in a exception. Note in portlet mode the view
// could be encoded as a query param, so the viewId could be valid.
- if (viewId != null && viewId.equals(mapping.getPrefix()) &&
+ if (viewId.equals(mapping.getPrefix()) &&
!ExternalContextUtils.isPortlet(context.getExternalContext()))
{
throw new InvalidViewIdException();
@@ -170,7 +170,7 @@ public class DefaultViewHandlerSupport i
return (checkResourceExists(context,viewId) ? viewId : null);
}
}
- else if (viewId != null && mapping.getUrlPattern().startsWith(viewId))
+ else if (mapping.getUrlPattern().startsWith(viewId))
{
throw new InvalidViewIdException(viewId);
}
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java Tue Jan 7 20:38:56 2014
@@ -18,7 +18,6 @@
*/
package org.apache.myfaces.shared.config;
-import java.util.logging.Logger;
import javax.faces.context.ExternalContext;
import javax.servlet.ServletContext;
@@ -42,9 +41,6 @@ import org.apache.myfaces.shared.util.We
*/
public class MyfacesConfig
{
- //private static final Log log = LogFactory.getLog(MyfacesConfig.class);
- private static final Logger log = Logger.getLogger(MyfacesConfig.class.getName());
-
private static final String APPLICATION_MAP_PARAM_NAME = MyfacesConfig.class.getName();
/**
@@ -355,13 +351,13 @@ public class MyfacesConfig
* Enable or disable a cache used to "remember" the generated facelets unique ids and reduce
* the impact on memory usage, only active if javax.faces.FACELETS_REFRESH_PERIOD is -1 (no refresh).
*/
- @JSFWebConfigParam(defaultValue = "false", since = "2.0.13, 2.1.7", expectedValues="true, false",
+ @JSFWebConfigParam(defaultValue = "true", since = "2.0.13, 2.1.7", expectedValues="true, false",
group="viewhandler", tags="performance",
desc="Enable or disable a cache used to 'remember' the generated facelets unique ids " +
"and reduce the impact over memory usage.")
public static final String INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED =
"org.apache.myfaces.VIEW_UNIQUE_IDS_CACHE_ENABLED";
- public static final boolean INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED_DEFAULT = false;
+ public static final boolean INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED_DEFAULT = true;
/**
* Set the size of the cache used to store strings generated using SectionUniqueIdCounter
@@ -448,6 +444,17 @@ public class MyfacesConfig
private static final String INIT_PARAM_CDI_MANAGED_VALIDATORS_ENABLED =
"org.apache.myfaces.CDI_MANAGED_VALIDATORS_ENABLED";
private static final boolean INIT_PARAM_CDI_MANAGED_VALIDATORS_DEFAULT = false;
+
+ /**
+ * This param makes components like c:set, ui:param and templating components like ui:decorate,
+ * ui:composition and ui:include to behave like the ones provided originally in facelets 1_1_x.
+ * See MYFACES-3810 for details.
+ */
+ @JSFWebConfigParam(since = "2.2.0", defaultValue="false", expectedValues="true,false",
+ group="viewhandler")
+ public static final String INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY =
+ "org.apache.myfaces.STRICT_JSF_2_FACELETS_COMPATIBILITY";
+ public final static boolean INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT = false;
private boolean _prettyHtml;
private boolean _detectJavascript;
@@ -484,6 +491,7 @@ public class MyfacesConfig
private boolean _earlyFlushEnabled;
private boolean _cdiManagedConvertersEnabled;
private boolean _cdiManagedValidatorsEnabled;
+ private boolean _strictJsf2FaceletsCompatibility;
private static final boolean TOMAHAWK_AVAILABLE;
private static final boolean MYFACES_IMPL_AVAILABLE;
@@ -588,6 +596,7 @@ public class MyfacesConfig
setEarlyFlushEnabled(INIT_PARAM_EARLY_FLUSH_ENABLED_DEFAULT);
setCdiManagedConvertersEnabled(INIT_PARAM_CDI_MANAGED_CONVERTERS_DEFAULT);
setCdiManagedValidatorsEnabled(INIT_PARAM_CDI_MANAGED_VALIDATORS_DEFAULT);
+ setStrictJsf2FaceletsCompatibility(INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT);
}
private static MyfacesConfig createAndInitializeMyFacesConfig(ExternalContext extCtx)
@@ -706,6 +715,10 @@ public class MyfacesConfig
myfacesConfig.setCdiManagedValidatorsEnabled(WebConfigParamUtils.getBooleanInitParameter(extCtx,
INIT_PARAM_CDI_MANAGED_VALIDATORS_ENABLED, INIT_PARAM_CDI_MANAGED_VALIDATORS_DEFAULT));
+ myfacesConfig.setStrictJsf2FaceletsCompatibility(WebConfigParamUtils.getBooleanInitParameter(extCtx,
+ INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY,
+ INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT));
+
if (TOMAHAWK_AVAILABLE)
{
myfacesConfig.setDetectJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_DETECT_JAVASCRIPT,
@@ -1263,4 +1276,14 @@ public class MyfacesConfig
{
this._cdiManagedValidatorsEnabled = cdiManagedValidatorsEnabled;
}
+
+ public boolean isStrictJsf2FaceletsCompatibility()
+ {
+ return _strictJsf2FaceletsCompatibility;
+ }
+
+ public void setStrictJsf2FaceletsCompatibility(boolean strictJsf2FaceletsCompatibility)
+ {
+ this._strictJsf2FaceletsCompatibility = strictJsf2FaceletsCompatibility;
+ }
}
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/AjaxExceptionHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/AjaxExceptionHandlerImpl.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/AjaxExceptionHandlerImpl.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/AjaxExceptionHandlerImpl.java Tue Jan 7 20:38:56 2014
@@ -42,7 +42,6 @@ import javax.faces.event.SystemEvent;
/**
*
* Specialized Ajax Handler, according to JSF 2.0 rev A section 13.3.7.
- *
*/
public class AjaxExceptionHandlerImpl extends ExceptionHandler
{
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/SwitchAjaxExceptionHandlerWrapperImpl.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/SwitchAjaxExceptionHandlerWrapperImpl.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/SwitchAjaxExceptionHandlerWrapperImpl.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/SwitchAjaxExceptionHandlerWrapperImpl.java Tue Jan 7 20:38:56 2014
@@ -31,7 +31,6 @@ import javax.faces.event.SystemEvent;
* normal exceptionHandler wrapping, because FacesContext is initialized after
* ExceptionHandler, so it is not safe to get it when
* ExceptionHandlerFactory.getExceptionHandler() is called.
- *
*/
public class SwitchAjaxExceptionHandlerWrapperImpl extends ExceptionHandlerWrapper
{
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/flash/FlashImpl.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/flash/FlashImpl.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/flash/FlashImpl.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/context/flash/FlashImpl.java Tue Jan 7 20:38:56 2014
@@ -18,6 +18,7 @@
*/
package org.apache.myfaces.shared.context.flash;
+import org.apache.myfaces.shared.util.SubKeyMap;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
import org.apache.myfaces.shared.util.ExternalContextUtils;
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java Tue Jan 7 20:38:56 2014
@@ -48,7 +48,6 @@ import javax.faces.component.NamingConta
import javax.faces.component.UIComponent;
import javax.faces.component.UIForm;
import javax.faces.component.UIInput;
-import javax.faces.component.UINamingContainer;
import javax.faces.component.UIOutput;
import javax.faces.component.UISelectMany;
import javax.faces.component.UISelectOne;
@@ -202,7 +201,7 @@ public final class RendererUtils
{
if (parent instanceof NamingContainer)
{
- idBuf.insert(0, UINamingContainer.getSeparatorChar(context));
+ idBuf.insert(0, context.getNamingContainerSeparatorChar());
idBuf.insert(0, parent.getId());
}
}
@@ -970,7 +969,7 @@ public final class RendererUtils
//To be compatible with jsf ri, and according to issue 69
//[ Permit the passing of a null value to SelectItem.setValue() ]
//If submittedValue == "" then convert to null.
- if ((submittedValue != null) && (submittedValue instanceof String)
+ if ((submittedValue != null)
&& ("".equals(submittedValue)))
{
//Replace "" by null value
@@ -1187,28 +1186,6 @@ public final class RendererUtils
dest.setValidator(src.getValidator());
}
- /**
- * @deprecated Logic corrected and encapsulated better in org.apache.myfaces.renderkit.ServerSideStateCacheImpl
- */
- @Deprecated
- public static Integer getViewSequence(FacesContext facescontext)
- {
- Map map = facescontext.getExternalContext().getRequestMap();
- Integer sequence = (Integer) map.get(SEQUENCE_PARAM);
- if (sequence == null)
- {
- sequence = new Integer(1);
- map.put(SEQUENCE_PARAM, sequence);
-
- synchronized (facescontext.getExternalContext().getSession(true))
- {
- facescontext.getExternalContext().getSessionMap()
- .put(RendererUtils.SEQUENCE_PARAM, sequence);
- }
- }
- return sequence;
- }
-
public static UIComponent findComponent(UIComponent headerComp, Class clazz)
{
if (clazz.isAssignableFrom(headerComp.getClass()))
@@ -1259,8 +1236,7 @@ public final class RendererUtils
UIComponent forComponent = uiComponent.findComponent(forAttr);
if (forComponent == null)
{
- final char separatorChar = UINamingContainer
- .getSeparatorChar(facesContext);
+ final char separatorChar = facesContext.getNamingContainerSeparatorChar();
Level level = Level.WARNING;
boolean productionStage = facesContext.isProjectStage(ProjectStage.Production);
@@ -1427,7 +1403,7 @@ public final class RendererUtils
}
}
- return content.toString();
+ return content != null ? content.toString() : null;
}
/**
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/CommonPropertyUtils.java Tue Jan 7 20:38:56 2014
@@ -43,7 +43,7 @@ public final class CommonPropertyUtils
return component.getId() != null && !component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX);
}
- public static final void renderUniversalProperties(ResponseWriter writer,
+ public static void renderUniversalProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -69,7 +69,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderUniversalPropertiesWithoutTitle(ResponseWriter writer,
+ public static void renderUniversalPropertiesWithoutTitle(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -90,7 +90,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderStyleProperties(ResponseWriter writer,
+ public static void renderStyleProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -106,7 +106,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderEventProperties(ResponseWriter writer,
+ public static void renderEventProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -118,7 +118,7 @@ public final class CommonPropertyUtils
renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, component);
}
- public static final void renderEventPropertiesWithoutOnclick(ResponseWriter writer,
+ public static void renderEventPropertiesWithoutOnclick(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -170,7 +170,7 @@ public final class CommonPropertyUtils
}
- public static final void renderChangeSelectEventProperties(ResponseWriter writer,
+ public static void renderChangeSelectEventProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -186,7 +186,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderFocusBlurEventProperties(ResponseWriter writer,
+ public static void renderFocusBlurEventProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -202,7 +202,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderFieldEventPropertiesWithoutOnchangeAndOnselect(ResponseWriter writer,
+ public static void renderFieldEventPropertiesWithoutOnchangeAndOnselect(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component) throws IOException
{
if ((commonPropertiesMarked & CommonPropertyConstants.ONFOCUS_PROP) != 0)
@@ -217,7 +217,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderFieldEventPropertiesWithoutOnchange(ResponseWriter writer,
+ public static void renderFieldEventPropertiesWithoutOnchange(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component) throws IOException
{
if ((commonPropertiesMarked & CommonPropertyConstants.ONFOCUS_PROP) != 0)
@@ -237,7 +237,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderChangeEventProperty(ResponseWriter writer,
+ public static void renderChangeEventProperty(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component) throws IOException
{
if ((commonPropertiesMarked & CommonPropertyConstants.ONCHANGE_PROP) != 0)
@@ -279,7 +279,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderInputProperties(ResponseWriter writer,
+ public static void renderInputProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -315,7 +315,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderAnchorProperties(ResponseWriter writer,
+ public static void renderAnchorProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -362,7 +362,7 @@ public final class CommonPropertyUtils
}
}
- public static final void renderCommonPassthroughPropertiesWithoutEvents(ResponseWriter writer,
+ public static void renderCommonPassthroughPropertiesWithoutEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -370,7 +370,7 @@ public final class CommonPropertyUtils
renderUniversalProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderCommonPassthroughProperties(ResponseWriter writer,
+ public static void renderCommonPassthroughProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -380,7 +380,7 @@ public final class CommonPropertyUtils
}
//Methods
- public static final void renderCommonFieldEventProperties(ResponseWriter writer,
+ public static void renderCommonFieldEventProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -388,7 +388,7 @@ public final class CommonPropertyUtils
renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderCommonFieldPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
+ public static void renderCommonFieldPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -397,7 +397,7 @@ public final class CommonPropertyUtils
renderCommonFieldEventProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
+ public static void renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -405,7 +405,7 @@ public final class CommonPropertyUtils
renderAccesskeyTabindexProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderInputPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
+ public static void renderInputPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -413,7 +413,7 @@ public final class CommonPropertyUtils
renderCommonFieldPassthroughPropertiesWithoutDisabled(writer, commonPropertiesMarked, component);
}
- public static final void renderInputPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
+ public static void renderInputPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -421,7 +421,7 @@ public final class CommonPropertyUtils
renderCommonFieldPassthroughPropertiesWithoutDisabledAndEvents(writer, commonPropertiesMarked, component);
}
- public static final void renderAnchorPassthroughProperties(ResponseWriter writer,
+ public static void renderAnchorPassthroughProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -430,7 +430,7 @@ public final class CommonPropertyUtils
renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderAnchorPassthroughPropertiesWithoutEvents(ResponseWriter writer,
+ public static void renderAnchorPassthroughPropertiesWithoutEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -439,7 +439,7 @@ public final class CommonPropertyUtils
renderUniversalProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderAnchorPassthroughPropertiesWithoutStyleAndEvents(ResponseWriter writer,
+ public static void renderAnchorPassthroughPropertiesWithoutStyleAndEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -447,7 +447,7 @@ public final class CommonPropertyUtils
renderUniversalProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderAnchorPassthroughPropertiesWithoutStyle(ResponseWriter writer,
+ public static void renderAnchorPassthroughPropertiesWithoutStyle(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -457,7 +457,7 @@ public final class CommonPropertyUtils
renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderAnchorPassthroughPropertiesWithoutOnclickAndStyle(ResponseWriter writer,
+ public static void renderAnchorPassthroughPropertiesWithoutOnclickAndStyle(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -467,7 +467,7 @@ public final class CommonPropertyUtils
renderFocusBlurEventProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderButtonPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
+ public static void renderButtonPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -477,7 +477,7 @@ public final class CommonPropertyUtils
renderAltAlignProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderLabelProperties(ResponseWriter writer,
+ public static void renderLabelProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -490,7 +490,7 @@ public final class CommonPropertyUtils
}
- public static final void renderLabelPassthroughProperties(ResponseWriter writer,
+ public static void renderLabelPassthroughProperties(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -498,7 +498,7 @@ public final class CommonPropertyUtils
renderCommonPassthroughProperties(writer, commonPropertiesMarked, component);
}
- public static final void renderLabelPassthroughPropertiesWithoutEvents(ResponseWriter writer,
+ public static void renderLabelPassthroughPropertiesWithoutEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
@@ -510,14 +510,14 @@ public final class CommonPropertyUtils
renderCommonPassthroughPropertiesWithoutEvents(writer, commonPropertiesMarked, component);
}
- public static final void renderSelectPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
+ public static void renderSelectPassthroughPropertiesWithoutDisabled(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
renderCommonFieldPassthroughPropertiesWithoutDisabled(writer, commonPropertiesMarked, component);
}
- public static final void renderSelectPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
+ public static void renderSelectPassthroughPropertiesWithoutDisabledAndEvents(ResponseWriter writer,
long commonPropertiesMarked, UIComponent component)
throws IOException
{
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlBodyRendererBase.java Tue Jan 7 20:38:56 2014
@@ -31,7 +31,6 @@ import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import org.apache.myfaces.shared.renderkit.ClientBehaviorEvents;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
/**
@@ -59,8 +58,7 @@ public class HtmlBodyRendererBase extend
ResponseWriter writer = facesContext.getResponseWriter();
Map<String, List<ClientBehavior>> behaviors = null;
- if (component instanceof ClientBehaviorHolder &&
- JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (component instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
if (!behaviors.isEmpty())
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=1556349&r1=1556348&r2=1556349&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 Tue Jan 7 20:38:56 2014
@@ -30,11 +30,9 @@ import javax.faces.component.UIParameter
import javax.faces.component.ValueHolder;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorContext;
-import javax.faces.component.behavior.ClientBehaviorHint;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.component.html.HtmlCommandButton;
import javax.faces.component.html.HtmlCommandLink;
-import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
@@ -149,9 +147,7 @@ public class HtmlButtonRendererBase
List<UIParameter> validParams = HtmlRendererUtils.getValidUIParameterChildren(
facesContext, childrenList, false, false);
- boolean javascriptAllowed = JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext());
-
- if (formInfo != null && javascriptAllowed
+ if (formInfo != null
&& (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll() ||
(validParams != null && !validParams.isEmpty() )))
{
@@ -170,8 +166,6 @@ public class HtmlButtonRendererBase
writer.writeAttribute(HTML.ID_ATTR, clientId, org.apache.myfaces.shared.renderkit.JSFAttr.ID_ATTR);
writer.writeAttribute(HTML.NAME_ATTR, clientId, JSFAttr.ID_ATTR);
- ExternalContext externalContext = facesContext.getExternalContext();
-
String image = RendererUtils.getIconSrc(facesContext, uiComponent, JSFAttr.IMAGE_ATTR);
if (image != null)
{
@@ -196,8 +190,7 @@ public class HtmlButtonRendererBase
}
}
- if (javascriptAllowed &&
- (HtmlRendererUtils.hasClientBehavior(ClientBehaviorEvents.CLICK, behaviors, facesContext) ||
+ if ((HtmlRendererUtils.hasClientBehavior(ClientBehaviorEvents.CLICK, behaviors, facesContext) ||
HtmlRendererUtils.hasClientBehavior(ClientBehaviorEvents.ACTION, behaviors, facesContext)))
{
if (!reset && !button)
@@ -230,7 +223,7 @@ public class HtmlButtonRendererBase
facesContext, uiComponent, ClientBehaviorEvents.DBLCLICK, null, behaviors,
(String) attributes.get(HTML.ONDBLCLICK_ATTR), "");
}
- else if (javascriptAllowed)
+ else
{
//fallback into the pre 2.0 code to keep backwards compatibility with libraries which rely on internals
if (!reset && !button)
@@ -324,22 +317,6 @@ public class HtmlButtonRendererBase
}*/
}
- private boolean hasSubmittingBehavior(Map<String, List<ClientBehavior>> clientBehaviors, String eventName)
- {
- List<ClientBehavior> eventBehaviors = clientBehaviors.get(eventName);
- if (eventBehaviors != null && !eventBehaviors.isEmpty())
- {
- for (ClientBehavior behavior : eventBehaviors)
- {
- if (behavior.getHints().contains(ClientBehaviorHint.SUBMITTING))
- {
- return true;
- }
- }
- }
- return false;
- }
-
protected String buildBehaviorizedOnClick(UIComponent uiComponent, Map<String, List<ClientBehavior>> behaviors,
FacesContext facesContext, ResponseWriter writer,
FormInfo nestedFormInfo, List<UIParameter> validParams)
@@ -416,24 +393,14 @@ public class HtmlButtonRendererBase
}
else
{
- StringBuilder params = addChildParameters(facesContext, component, nestingForm, validParams);
+ StringBuilder params = addChildParameters(facesContext, nestingForm, validParams);
String target = getTarget(component);
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME).append("('").
- append(formName).append("','").
- append(component.getClientId(facesContext)).append("'");
- }
- else
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
- append(formName).append("','").
- append(component.getClientId(facesContext)).append("'");
- }
+ onClick.append("return ").
+ append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
+ append(formName).append("','").
+ append(component.getClientId(facesContext)).append("'");
if (params.length() > 2 || target != null)
{
@@ -452,7 +419,7 @@ public class HtmlButtonRendererBase
return onClick.toString();
}
- private StringBuilder addChildParameters(FacesContext context, UIComponent component,
+ private StringBuilder addChildParameters(FacesContext context,
UIComponent nestingForm, List<UIParameter> validParams)
{
//add child parameters
@@ -592,25 +559,14 @@ public class HtmlButtonRendererBase
if (validParams != null && !validParams.isEmpty() )
{
StringBuilder params = addChildParameters(
- facesContext, uiComponent, nestedFormInfo.getForm(), validParams);
+ facesContext, nestedFormInfo.getForm(), validParams);
String target = getTarget(uiComponent);
- if (MyfacesConfig.getCurrentInstance(
- facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME).append("('").
- append(formName).append("','").
- append(uiComponent.getClientId(facesContext)).append("'");
- }
- else
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
- append(formName).append("','").
- append(uiComponent.getClientId(facesContext)).append("'");
- }
+ onClick.append("return ").
+ append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
+ append(formName).append("','").
+ append(uiComponent.getClientId(facesContext)).append("'");
if (params.length() > 2 || target != null)
{
@@ -708,15 +664,6 @@ public class HtmlButtonRendererBase
uiComponent, HTML.READONLY_ATTR, false);
}
- private String getImage(UIComponent uiComponent)
- {
- if (uiComponent instanceof HtmlCommandButton)
- {
- return ((HtmlCommandButton)uiComponent).getImage();
- }
- return (String)uiComponent.getAttributes().get(JSFAttr.IMAGE_ATTR);
- }
-
private String getType(UIComponent uiComponent)
{
if (uiComponent instanceof HtmlCommandButton)
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlCheckboxRendererBase.java Tue Jan 7 20:38:56 2014
@@ -26,7 +26,6 @@ import java.util.Set;
import java.util.logging.Logger;
import javax.faces.component.UIComponent;
-import javax.faces.component.UINamingContainer;
import javax.faces.component.UISelectBoolean;
import javax.faces.component.UISelectMany;
import javax.faces.component.UISelectOne;
@@ -42,7 +41,6 @@ import javax.faces.model.SelectItem;
import javax.faces.model.SelectItemGroup;
import org.apache.myfaces.shared.renderkit.JSFAttr;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
public class HtmlCheckboxRendererBase extends HtmlRenderer
@@ -331,7 +329,7 @@ public class HtmlCheckboxRendererBase ex
String clientId = uiComponent.getClientId(facesContext);
String itemId = (itemNum == null)? null : clientId +
- UINamingContainer.getSeparatorChar(facesContext) + itemNum;
+ facesContext.getNamingContainerSeparatorChar() + itemNum;
ResponseWriter writer = facesContext.getResponseWriter();
@@ -367,8 +365,7 @@ public class HtmlCheckboxRendererBase ex
Map<String, List<ClientBehavior>> behaviors = null;
if (uiComponent instanceof UISelectBoolean)
{
- if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
@@ -414,8 +411,7 @@ public class HtmlCheckboxRendererBase ex
}
else
{
- if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java Tue Jan 7 20:38:56 2014
@@ -35,7 +35,6 @@ import javax.faces.context.ResponseWrite
import org.apache.myfaces.shared.config.MyfacesConfig;
import org.apache.myfaces.shared.renderkit.JSFAttr;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
public class HtmlFormRendererBase
@@ -88,8 +87,7 @@ public class HtmlFormRendererBase
encodedActionURL,
null);
- if (htmlForm instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (htmlForm instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) htmlForm).getClientBehaviors();
if (behaviors.isEmpty() && isCommonPropertiesOptimizationEnabled(facesContext))
@@ -309,15 +307,6 @@ public class HtmlFormRendererBase
}
}
- private String getAcceptCharset(UIComponent uiComponent)
- {
- if (uiComponent instanceof HtmlForm)
- {
- return ((HtmlForm)uiComponent).getAcceptcharset();
- }
- return (String)uiComponent.getAttributes().get(JSFAttr.ACCEPTCHARSET_ATTR);
- }
-
/**
* Called before the state and any elements are added to the form tag in the
* encodeBegin method
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlGridRendererBase.java Tue Jan 7 20:38:56 2014
@@ -35,7 +35,6 @@ import javax.faces.context.ResponseWrite
import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.shared.util.ArrayUtils;
import org.apache.myfaces.shared.util.StringUtils;
@@ -116,8 +115,7 @@ public class HtmlGridRendererBase
writer.startElement(HTML.TABLE_ELEM, component);
- if (component instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (component instanceof ClientBehaviorHolder)
{
if (!behaviors.isEmpty())
{
@@ -205,7 +203,6 @@ public class HtmlGridRendererBase
return;
}
- HtmlRendererUtils.writePrettyLineSeparator(context);
writer.startElement(
header ? org.apache.myfaces.shared.renderkit.html.HTML.THEAD_ELEM : HTML.TFOOT_ELEM, null);
// component);
@@ -234,11 +231,9 @@ public class HtmlGridRendererBase
writer.writeAttribute(HTML.COLSPAN_ATTR, Integer.toString(columns), null);
- HtmlRendererUtils.writePrettyLineSeparator(context);
//RendererUtils.renderChild(context, facet);
facet.encodeAll(context);
- HtmlRendererUtils.writePrettyLineSeparator(context);
writer.endElement(header ? HTML.TH_ELEM : HTML.TD_ELEM);
writer.endElement(HTML.TR_ELEM);
writer.endElement(header ? HTML.THEAD_ELEM : HTML.TFOOT_ELEM);
@@ -324,7 +319,6 @@ public class HtmlGridRendererBase
{
//do we have to close the last row?
writer.endElement(HTML.TR_ELEM);
- HtmlRendererUtils.writePrettyLineSeparator(context);
}
// is the current row listed in the bodyrows attribute
@@ -334,10 +328,8 @@ public class HtmlGridRendererBase
if(bodyrowsCount != 0)
{
writer.endElement(HTML.TBODY_ELEM);
- HtmlRendererUtils.writePrettyLineSeparator(context);
}
writer.startElement(HTML.TBODY_ELEM, null); // component);
- HtmlRendererUtils.writePrettyLineSeparator(context);
bodyrowsCount++;
}
@@ -396,13 +388,11 @@ public class HtmlGridRendererBase
}
}
writer.endElement(HTML.TR_ELEM);
- HtmlRendererUtils.writePrettyLineSeparator(context);
// close any preopened TBODY element first
if(bodyrowsCount != 0)
{
writer.endElement(HTML.TBODY_ELEM);
- HtmlRendererUtils.writePrettyLineSeparator(context);
}
}
}
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlImageRendererBase.java Tue Jan 7 20:38:56 2014
@@ -34,7 +34,6 @@ import javax.faces.context.ResponseWrite
import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
@@ -72,8 +71,7 @@ public class HtmlImageRendererBase
writer.startElement(HTML.IMG_ELEM, uiComponent);
- if (uiComponent instanceof ClientBehaviorHolder
- && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext())
+ if (uiComponent instanceof ClientBehaviorHolder
&& !behaviors.isEmpty())
{
HtmlRendererUtils.writeIdAndName(writer, uiComponent, facesContext);
@@ -111,8 +109,7 @@ public class HtmlImageRendererBase
}
}
- if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder)
{
if (behaviors.isEmpty() && isCommonPropertiesOptimizationEnabled(facesContext))
{
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java Tue Jan 7 20:38:56 2014
@@ -42,7 +42,6 @@ import javax.faces.component.html.HtmlFo
import javax.faces.component.html.HtmlInputText;
import org.apache.myfaces.shared.renderkit.html.util.FormInfo;
import org.apache.myfaces.shared.renderkit.html.util.HttpPartWrapper;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.util._ComponentUtils;
public class HtmlInputFileRendererBase extends HtmlRenderer
@@ -169,8 +168,7 @@ public class HtmlInputFileRendererBase e
renderValue(facesContext, component, writer);
Map<String, List<ClientBehavior>> behaviors = null;
- if (component instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (component instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java Tue Jan 7 20:38:56 2014
@@ -24,7 +24,6 @@ import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
-import javax.faces.component.UINamingContainer;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -81,35 +80,9 @@ public final class HtmlJavaScriptUtils
private static void renderFormSubmitScriptIfNecessary(
FacesContext facesContext) throws IOException
{
- final ExternalContext externalContext = facesContext
- .getExternalContext();
- final MyfacesConfig currentInstance = MyfacesConfig
- .getCurrentInstance(externalContext);
ResponseWriter writer = facesContext.getResponseWriter();
-
- if (currentInstance.isRenderFormSubmitScriptInline())
- {
- writer.startElement(HTML.SCRIPT_ELEM, null);
- writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
-
- boolean autoScroll = currentInstance.isAutoScroll();
-
- ScriptContext context = new ScriptContext(
- currentInstance.isPrettyHtml());
- context.prettyLine();
- context.increaseIndent();
-
- prepareScript(facesContext, context, autoScroll);
-
- writer.writeText(context.toString(), null);
-
- writer.endElement(HTML.SCRIPT_ELEM);
- }
- else
- {
- ResourceUtils
- .renderMyfacesJSInlineIfNecessary(facesContext, writer);
- }
+ ResourceUtils
+ .renderMyfacesJSInlineIfNecessary(facesContext, writer);
}
private static void renderConfigOptionsIfNecessary(FacesContext facesContext)
@@ -118,7 +91,7 @@ public final class HtmlJavaScriptUtils
ResponseWriter writer = facesContext.getResponseWriter();
MyfacesConfig config = MyfacesConfig.getCurrentInstance(facesContext
.getExternalContext());
- ScriptContext script = new ScriptContext(config.isPrettyHtml());
+ ScriptContext script = new ScriptContext();
boolean autoScroll = config.isAutoScroll();
boolean autoSave = JavascriptUtils.isSaveFormSubmitLinkIE(facesContext
.getExternalContext());
@@ -157,8 +130,7 @@ public final class HtmlJavaScriptUtils
ScriptContext context, boolean autoScroll)
{
- final char separatorChar = UINamingContainer
- .getSeparatorChar(facesContext);
+ final char separatorChar = facesContext.getNamingContainerSeparatorChar();
context.prettyLine();
//render a function to create a hidden input, if it doesn't exist
@@ -398,15 +370,7 @@ public final class HtmlJavaScriptUtils
scriptContext.append("if(typeof window." + AUTO_SCROLL_FUNCTION
+ "!='undefined')");
scriptContext.append("{");
- if (MyfacesConfig.getCurrentInstance(context.getExternalContext())
- .isRenderFormSubmitScriptInline())
- {
- scriptContext.append(SET_HIDDEN_INPUT_FN_NAME);
- }
- else
- {
- scriptContext.append(SET_HIDDEN_INPUT_FN_NAME_JSF2);
- }
+ scriptContext.append(SET_HIDDEN_INPUT_FN_NAME_JSF2);
scriptContext.append("(").append(formNameStr).append(",")
.append(paramName).append(",").append(value).append(");");
scriptContext.append("}");
@@ -415,9 +379,7 @@ public final class HtmlJavaScriptUtils
public static String getAutoScrollFunction(FacesContext facesContext)
{
- ScriptContext script = new ScriptContext(MyfacesConfig
- .getCurrentInstance(facesContext.getExternalContext())
- .isPrettyHtml());
+ ScriptContext script = new ScriptContext();
script.prettyLineIncreaseIndent();
@@ -506,12 +468,10 @@ public final class HtmlJavaScriptUtils
public static void renderAutoScrollHiddenInput(FacesContext facesContext,
ResponseWriter writer) throws IOException
{
- HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.startElement(HTML.INPUT_ELEM, null);
writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
writer.writeAttribute(HTML.NAME_ATTR, AUTO_SCROLL_PARAM, null);
writer.endElement(HTML.INPUT_ELEM);
- HtmlRendererUtils.writePrettyLineSeparator(facesContext);
}
/**
@@ -520,13 +480,11 @@ public final class HtmlJavaScriptUtils
public static void renderAutoScrollFunction(FacesContext facesContext,
ResponseWriter writer) throws IOException
{
- HtmlRendererUtils.writePrettyLineSeparator(facesContext);
writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR,
HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
writer.writeText(getAutoScrollFunction(facesContext), null);
writer.endElement(HTML.SCRIPT_ELEM);
- HtmlRendererUtils.writePrettyLineSeparator(facesContext);
}
public static void appendClearHiddenCommandFormParamsFunctionCall(
@@ -575,8 +533,7 @@ public final class HtmlJavaScriptUtils
public static String getClearHiddenCommandFormParamsFunctionName(
String formName)
{
- final char separatorChar = UINamingContainer
- .getSeparatorChar(FacesContext.getCurrentInstance());
+ final char separatorChar = FacesContext.getCurrentInstance().getNamingContainerSeparatorChar();
if (formName == null)
{
return "'" + HtmlRendererUtils.CLEAR_HIDDEN_FIELD_FN_NAME
@@ -724,40 +681,4 @@ public final class HtmlJavaScriptUtils
return out.toString();
}
}
-
- public static void renderViewStateJavascript(FacesContext facesContext,
- String hiddenId, String serializedState) throws IOException
- {
- ResponseWriter writer = facesContext.getResponseWriter();
-
- writer.startElement(HTML.SCRIPT_ELEM, null);
- writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
-
- final ExternalContext externalContext = facesContext
- .getExternalContext();
- final MyfacesConfig currentInstance = MyfacesConfig
- .getCurrentInstance(externalContext);
-
- ScriptContext context = new ScriptContext(
- currentInstance.isPrettyHtml());
- context.prettyLine();
- context.increaseIndent();
-
- context.append("function setViewState() {\n");
- context.append("\tvar state = '");
- context.append(serializedState);
- context.append("';\n");
- context.append("\tfor (var i = 0; i < document.forms.length; i++) {\n");
- context.append("\t\tdocument.forms[i]['" + hiddenId
- + "'].value = state;\n");
- context.append("\t}\n");
- context.append("}\n");
- context.append("setViewState();\n");
-
- context.decreaseIndent();
-
- writer.writeText(context.toString(), null);
-
- writer.endElement(HTML.SCRIPT_ELEM);
- }
}
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=1556349&r1=1556348&r2=1556349&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 Tue Jan 7 20:38:56 2014
@@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.RandomAccess;
-import javax.faces.application.ViewHandler;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutcomeTarget;
@@ -48,7 +47,6 @@ import org.apache.myfaces.shared.renderk
import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.RendererUtils;
import org.apache.myfaces.shared.renderkit.html.util.FormInfo;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.shared.util._ComponentUtils;
@@ -231,8 +229,7 @@ public abstract class HtmlLinkRendererBa
if (HtmlRendererUtils.isDisabled(component) || formInfo == null)
{
writer.startElement(HTML.SPAN_ELEM, component);
- if (component instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (component instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -300,104 +297,87 @@ public abstract class HtmlLinkRendererBa
else
{
//String[] anchorAttrsToRender;
- if (JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (component instanceof ClientBehaviorHolder)
{
- if (component instanceof ClientBehaviorHolder)
+ behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
+ renderBehaviorizedJavaScriptAnchorStart(
+ facesContext, writer, component, clientId, behaviors, formInfo);
+ if (!behaviors.isEmpty())
{
- behaviors = ((ClientBehaviorHolder) component).getClientBehaviors();
- renderBehaviorizedJavaScriptAnchorStart(
- facesContext, writer, component, clientId, behaviors, formInfo);
- if (!behaviors.isEmpty())
- {
- HtmlRendererUtils.writeIdAndName(writer, component, facesContext);
- }
- else
- {
- // If onclick is not null, both onclick and server side script are rendered
- // using jsf.util.chain(...) js function. We need to check that case and force
- // id/name rendering. It is possible to do something else in that case and
- // do not render the script using jsf.util.chain, but for now it is ok.
- String commandOnclick;
- if (component instanceof HtmlCommandLink)
- {
- commandOnclick = ((HtmlCommandLink)component).getOnclick();
- }
- else
- {
- commandOnclick = (String)component.getAttributes().get(HTML.ONCLICK_ATTR);
- }
-
- if (commandOnclick != null)
- {
- HtmlRendererUtils.writeIdAndName(writer, component, facesContext);
- }
- else
- {
- HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
- }
- }
- long commonPropertiesMarked = 0L;
- if (isCommonPropertiesOptimizationEnabled(facesContext))
+ HtmlRendererUtils.writeIdAndName(writer, component, facesContext);
+ }
+ else
+ {
+ // If onclick is not null, both onclick and server side script are rendered
+ // using jsf.util.chain(...) js function. We need to check that case and force
+ // id/name rendering. It is possible to do something else in that case and
+ // do not render the script using jsf.util.chain, but for now it is ok.
+ String commandOnclick;
+ if (component instanceof HtmlCommandLink)
{
- commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(component);
- }
- if (behaviors.isEmpty() && isCommonPropertiesOptimizationEnabled(facesContext))
- {
- CommonPropertyUtils.renderEventPropertiesWithoutOnclick(writer,
- commonPropertiesMarked, component);
- CommonPropertyUtils.renderFocusBlurEventProperties(writer,
- commonPropertiesMarked, component);
+ commandOnclick = ((HtmlCommandLink)component).getOnclick();
}
else
{
- HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
- facesContext, writer, component, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
- facesContext, writer, component, behaviors);
+ commandOnclick = (String)component.getAttributes().get(HTML.ONCLICK_ATTR);
}
- if (isCommonPropertiesOptimizationEnabled(facesContext))
+
+ if (commandOnclick != null)
{
- CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutStyleAndEvents(writer,
- commonPropertiesMarked, component);
+ HtmlRendererUtils.writeIdAndName(writer, component, facesContext);
}
else
{
- HtmlRendererUtils.renderHTMLAttributes(writer, component,
- HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE_AND_EVENTS);
+ HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
}
}
+ long commonPropertiesMarked = 0L;
+ if (isCommonPropertiesOptimizationEnabled(facesContext))
+ {
+ commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(component);
+ }
+ if (behaviors.isEmpty() && isCommonPropertiesOptimizationEnabled(facesContext))
+ {
+ CommonPropertyUtils.renderEventPropertiesWithoutOnclick(writer,
+ commonPropertiesMarked, component);
+ CommonPropertyUtils.renderFocusBlurEventProperties(writer,
+ commonPropertiesMarked, component);
+ }
else
{
- renderJavaScriptAnchorStart(facesContext, writer, component, clientId, formInfo);
- HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
- if (isCommonPropertiesOptimizationEnabled(facesContext))
- {
- CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutOnclickAndStyle(writer,
- CommonPropertyUtils.getCommonPropertiesMarked(component), component);
- }
- else
- {
- HtmlRendererUtils.renderHTMLAttributes(writer, component,
- HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE);
- }
+ HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
+ facesContext, writer, component, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, component, behaviors);
+ }
+ if (isCommonPropertiesOptimizationEnabled(facesContext))
+ {
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutStyleAndEvents(writer,
+ commonPropertiesMarked, component);
+ }
+ else
+ {
+ HtmlRendererUtils.renderHTMLAttributes(writer, component,
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE_AND_EVENTS);
}
}
else
{
- renderNonJavaScriptAnchorStart(facesContext, writer, component, clientId, formInfo);
+ renderJavaScriptAnchorStart(facesContext, writer, component, clientId, formInfo);
HtmlRendererUtils.writeIdIfNecessary(writer, component, facesContext);
if (isCommonPropertiesOptimizationEnabled(facesContext))
{
- CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutStyle(writer,
+ CommonPropertyUtils.renderAnchorPassthroughPropertiesWithoutOnclickAndStyle(writer,
CommonPropertyUtils.getCommonPropertiesMarked(component), component);
}
else
{
HtmlRendererUtils.renderHTMLAttributes(writer, component,
- HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_STYLE);
+ HTML.ANCHOR_PASSTHROUGH_ATTRIBUTES_WITHOUT_ONCLICK_WITHOUT_STYLE);
}
}
+
//HtmlRendererUtils.renderHTMLAttributes(writer, component,
// anchorAttrsToRender);
HtmlRendererUtils.renderHTMLAttribute(writer, HTML.STYLE_ATTR, HTML.STYLE_ATTR,
@@ -465,20 +445,10 @@ public abstract class HtmlLinkRendererBa
String target = getTarget(component);
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME).append("('").
- append(formName).append("','").
- append(clientId).append("'");
- }
- else
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
- append(formName).append("','").
- append(clientId).append("'");
- }
+ onClick.append("return ").
+ append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
+ append(formName).append("','").
+ append(clientId).append("'");
if (params.length() > 2 || target != null)
{
@@ -625,21 +595,10 @@ public abstract class HtmlLinkRendererBa
String target = getTarget(component);
- if (MyfacesConfig.getCurrentInstance(
- facesContext.getExternalContext()).isRenderFormSubmitScriptInline())
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME).append("('").
- append(formName).append("','").
- append(clientId).append("'");
- }
- else
- {
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
- append(formName).append("','").
- append(clientId).append("'");
- }
+ onClick.append("return ").
+ append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
+ append(formName).append("','").
+ append(clientId).append("'");
if (params.length() > 2 || target != null)
{
@@ -775,60 +734,6 @@ public abstract class HtmlLinkRendererBa
}
}
-
- protected void renderNonJavaScriptAnchorStart(FacesContext facesContext,
- ResponseWriter writer,
- UIComponent component,
- String clientId,
- FormInfo formInfo)
- throws IOException
- {
- ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
- String viewId = facesContext.getViewRoot().getViewId();
- String path = viewHandler.getActionURL(facesContext, viewId);
-
- boolean strictXhtmlLinks
- = MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isStrictXhtmlLinks();
-
- StringBuilder hrefBuf = new StringBuilder(path);
-
- //add clientId parameter for decode
-
- if (path.indexOf('?') == -1)
- {
- hrefBuf.append('?');
- }
- else
- {
- if (strictXhtmlLinks)
- {
- hrefBuf.append("&");
- }
- else
- {
- hrefBuf.append('&');
- }
- }
- String hiddenFieldName = HtmlRendererUtils.getHiddenCommandLinkFieldName(
- formInfo, facesContext);
- hrefBuf.append(hiddenFieldName);
- hrefBuf.append('=');
- hrefBuf.append(clientId);
-
- if (getChildCount(component) > 0)
- {
- addChildParametersToHref(facesContext, component, hrefBuf,
- false, //not the first url parameter
- writer.getCharacterEncoding());
- }
-
- String href = facesContext.getExternalContext().encodeActionURL(hrefBuf.toString());
- writer.startElement(HTML.ANCHOR_ELEM, component);
- writer.writeURIAttribute(HTML.HREF_ATTR,
- facesContext.getExternalContext().encodeActionURL(href),
- null);
- }
-
private void addChildParametersToHref(FacesContext facesContext,
UIComponent linkComponent,
StringBuilder hrefBuf,
@@ -869,8 +774,7 @@ public abstract class HtmlLinkRendererBa
if (HtmlRendererUtils.isDisabled(output))
{
writer.startElement(HTML.SPAN_ELEM, output);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -982,8 +886,7 @@ public abstract class HtmlLinkRendererBa
//write anchor
writer.startElement(HTML.ANCHOR_ELEM, output);
writer.writeURIAttribute(HTML.HREF_ATTR, href, null);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -1067,8 +970,7 @@ public abstract class HtmlLinkRendererBa
//to just put this flag on FacesContext attribute map
facesContext.getAttributes().put(END_LINK_OUTCOME_AS_SPAN, Boolean.TRUE);
writer.startElement(HTML.SPAN_ELEM, output);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -1145,8 +1047,7 @@ public abstract class HtmlLinkRendererBa
//write anchor
writer.startElement(HTML.ANCHOR_ELEM, output);
writer.writeURIAttribute(HTML.HREF_ATTR, targetHref, null);
- if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (output instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) output).getClientBehaviors();
if (!behaviors.isEmpty())
@@ -1215,27 +1116,6 @@ public abstract class HtmlLinkRendererBa
writer.flush();
}
}
-
-
- private void renderLinkParameter(String name,
- Object value,
- StringBuilder onClick,
- String jsForm,
- UIComponent nestingForm)
- {
- if (name == null)
- {
- throw new IllegalArgumentException("Unnamed parameter value not allowed within command link.");
- }
- onClick.append(jsForm);
- onClick.append(".elements['").append(name).append("']");
- //UIParameter is no ValueHolder, so no conversion possible
- String strParamValue = value != null ? org.apache.myfaces.shared.renderkit.html.util.HTMLEncoder.encode(
- value.toString(), false, false) : "";
- onClick.append(".value='").append(strParamValue).append("';");
-
- addHiddenCommandParameter(FacesContext.getCurrentInstance(), nestingForm, name);
- }
private static void addParameterToHref(String name,
Object value,
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlMessageRendererBase.java Tue Jan 7 20:38:56 2014
@@ -36,7 +36,6 @@ import javax.faces.context.ResponseWrite
import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
public abstract class HtmlMessageRendererBase
extends HtmlRenderer
@@ -175,8 +174,7 @@ public abstract class HtmlMessageRendere
throws IOException
{
Map<String, List<ClientBehavior>> behaviors = null;
- if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (message instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) message).getClientBehaviors();
}
@@ -232,8 +230,7 @@ public abstract class HtmlMessageRendere
boolean span = false;
Map<String, List<ClientBehavior>> behaviors = null;
- if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed
- (facesContext.getExternalContext()))
+ if (message instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) message).getClientBehaviors();
// If there is a behavior registered, force wrapSpan
@@ -255,8 +252,7 @@ public abstract class HtmlMessageRendere
{
HtmlRendererUtils.writeIdIfNecessary(writer, message, facesContext);
}
- if (message instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (message instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) message).getClientBehaviors();
if (behaviors.isEmpty() && isCommonPropertiesOptimizationEnabled(facesContext))
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlOutcomeTargetButtonRendererBase.java Tue Jan 7 20:38:56 2014
@@ -34,7 +34,6 @@ import javax.faces.context.ResponseWrite
import org.apache.myfaces.shared.renderkit.ClientBehaviorEvents;
import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
/**
@@ -134,25 +133,17 @@ public class HtmlOutcomeTargetButtonRend
{
long commonPropertiesMarked = CommonPropertyUtils.getCommonPropertiesMarked(uiComponent);
- if (JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (behaviors != null && !behaviors.isEmpty() && uiComponent instanceof ClientBehaviorHolder)
{
- if (behaviors != null && !behaviors.isEmpty() && uiComponent instanceof ClientBehaviorHolder)
- {
- HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
- facesContext, writer, uiComponent, behaviors);
- HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
- facesContext, writer, uiComponent, behaviors);
- }
- else
- {
- CommonPropertyUtils.renderEventPropertiesWithoutOnclick(
- writer, commonPropertiesMarked, uiComponent);
- CommonPropertyUtils.renderFocusBlurEventProperties(writer, commonPropertiesMarked, uiComponent);
- }
+ HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
+ facesContext, writer, uiComponent, behaviors);
+ HtmlRendererUtils.renderBehaviorizedFieldEventHandlersWithoutOnchangeAndOnselect(
+ facesContext, writer, uiComponent, behaviors);
}
else
{
- CommonPropertyUtils.renderEventPropertiesWithoutOnclick(writer, commonPropertiesMarked, uiComponent);
+ CommonPropertyUtils.renderEventPropertiesWithoutOnclick(
+ writer, commonPropertiesMarked, uiComponent);
CommonPropertyUtils.renderFocusBlurEventProperties(writer, commonPropertiesMarked, uiComponent);
}
@@ -166,8 +157,7 @@ public class HtmlOutcomeTargetButtonRend
}
else
{
- if (uiComponent instanceof ClientBehaviorHolder
- && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder)
{
HtmlRendererUtils.renderBehaviorizedEventHandlersWithoutOnclick(
facesContext, writer, uiComponent, behaviors);
Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java?rev=1556349&r1=1556348&r2=1556349&view=diff
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java (original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRadioRendererBase.java Tue Jan 7 20:38:56 2014
@@ -26,7 +26,6 @@ import java.util.logging.Logger;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
-import javax.faces.component.UINamingContainer;
import javax.faces.component.UISelectOne;
import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorHolder;
@@ -40,7 +39,6 @@ import javax.faces.model.SelectItemGroup
import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils;
import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
public class HtmlRadioRendererBase
@@ -315,7 +313,7 @@ public class HtmlRadioRendererBase
String clientId = uiComponent.getClientId(facesContext);
String itemId = (itemNum == null)? null : clientId +
- UINamingContainer.getSeparatorChar(facesContext) + itemNum;
+ facesContext.getNamingContainerSeparatorChar() + itemNum;
ResponseWriter writer = facesContext.getResponseWriter();
@@ -352,8 +350,7 @@ public class HtmlRadioRendererBase
}
Map<String, List<ClientBehavior>> behaviors = null;
- if (uiComponent instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(
- facesContext.getExternalContext()))
+ if (uiComponent instanceof ClientBehaviorHolder)
{
behaviors = ((ClientBehaviorHolder) uiComponent).getClientBehaviors();