You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ta...@apache.org on 2018/10/19 16:27:30 UTC
[myfaces] 01/04: removed some trinidad, tobago,
adf and long-time deprecated code
This is an automated email from the ASF dual-hosted git repository.
tandraschko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces.git
commit 6001f7f82dde1f0b2ea7bff05e21b1a93c514cbb
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Fri Oct 19 16:13:34 2018 +0200
removed some trinidad, tobago, adf and long-time deprecated code
---
.../main/java/javax/faces/component/UIData.java | 2 -
.../javax/faces/component/_DeltaStateHelper.java | 4 -
.../component/behavior/_DeltaStateHelper.java | 4 -
.../myfaces/application/ResourceHandlerImpl.java | 5 +-
.../myfaces/application/StateCacheFactory.java | 37 ---
.../viewstate/ServerSideStateCacheImpl.java | 23 +-
.../config/DefaultFacesConfigurationMerger.java | 2 +-
.../config/DefaultFacesConfigurationProvider.java | 15 +-
.../apache/myfaces/config/FacesConfigurator.java | 74 +----
.../context/servlet/PartialViewContextImpl.java | 5 +-
.../renderkit/html/HtmlCommandScriptRenderer.java | 4 -
.../DefaultFaceletsStateManagementStrategy.java | 5 +-
.../facelets/FaceletViewDeclarationLanguage.java | 47 +--
.../myfaces/view/facelets/ViewPoolProcessor.java | 2 +-
.../facelets/compiler/FaceletsCompilerSupport.java | 25 +-
.../myfaces/view/facelets/compiler/UILeaf.java | 5 +-
.../view/facelets/compiler/_ComponentUtils.java | 367 ---------------------
.../facelets/impl/FaceletCacheFactoryImpl.java | 11 +-
.../view/facelets/tag/CompositeFaceletHandler.java | 63 ----
.../apache/myfaces/view/facelets/tag/MetaRule.java | 47 ---
.../view/facelets/tag/jsf/ComponentHandler.java | 345 -------------------
.../tag/jsf/ComponentTagHandlerDelegate.java | 5 +-
.../view/facelets/tag/jsf/ConvertHandler.java | 162 ---------
.../view/facelets/tag/jsf/ValidateHandler.java | 141 --------
.../view/facelets/tag/jsf/core/AjaxHandler.java | 3 +-
.../util/FaceletsViewDeclarationLanguageUtils.java | 5 +-
.../myfaces/webapp/AbstractFacesInitializer.java | 56 +---
.../resources/META-INF/WebConfigParamsLogger.vm | 59 +---
.../myfaces/test/AbstractClassElementTestCase.java | 5 +-
.../facelets/FaceletMultipleRequestsTestCase.java | 1 -
.../myfaces/view/facelets/FaceletTestCase.java | 1 -
.../tag/jsf/html/DefaultHtmlDecoratorTestCase.java | 5 +-
.../apache/myfaces/shared/util/ComponentUtils.java | 16 +
.../myfaces/shared/util/SelectItemsIterator.java | 3 +-
.../apache/myfaces/shared/util/_EmptyIterator.java | 41 ---
.../myfaces/shared/config/MyfacesConfig.java | 274 +--------------
.../myfaces/shared/renderkit/RendererUtils.java | 137 +-------
.../renderkit/html/HtmlButtonRendererBase.java | 69 ++--
.../renderkit/html/HtmlFormRendererBase.java | 4 -
.../renderkit/html/HtmlInputFileRendererBase.java | 5 +-
.../shared/renderkit/html/HtmlJavaScriptUtils.java | 14 +-
.../renderkit/html/HtmlLinkRendererBase.java | 118 +++----
.../shared/renderkit/html/HtmlRendererUtils.java | 14 +-
.../renderkit/html/HtmlResponseWriterImpl.java | 1 -
.../shared/renderkit/html/util/ResourceUtils.java | 124 ++-----
.../renderkit/html/util/SelectItemsUtils.java | 5 +-
.../shared/resource/ResourceLoaderUtils.java | 4 +-
.../org/apache/myfaces/shared/util/SubKeyMap.java | 2 -
.../myfaces/shared/util/_ComponentUtils.java | 38 ---
49 files changed, 174 insertions(+), 2230 deletions(-)
diff --git a/api/src/main/java/javax/faces/component/UIData.java b/api/src/main/java/javax/faces/component/UIData.java
index a972595..7e7e691 100644
--- a/api/src/main/java/javax/faces/component/UIData.java
+++ b/api/src/main/java/javax/faces/component/UIData.java
@@ -2445,8 +2445,6 @@ public class UIData extends UIComponentBase implements NamingContainer, UniqueId
* Indicates whether the state for a component in each row should not be
* discarded before the datatable is rendered again.
*
- * This property is similar to tomahawk t:dataTable preserveRowStates
- *
* This will only work reliable if the datamodel of the
* datatable did not change either by sorting, removing or
* adding rows. Default: false
diff --git a/api/src/main/java/javax/faces/component/_DeltaStateHelper.java b/api/src/main/java/javax/faces/component/_DeltaStateHelper.java
index 84db8fa..168f4ed 100644
--- a/api/src/main/java/javax/faces/component/_DeltaStateHelper.java
+++ b/api/src/main/java/javax/faces/component/_DeltaStateHelper.java
@@ -60,10 +60,6 @@ import javax.faces.context.FacesContext;
* and do a clean separation between initial state and delta.
* </p>
* <p>
- * The code from this class comes from a refactor of
- * org.apache.myfaces.trinidad.bean.util.PropertyHashMap
- * </p>
- * <p>
* The context from this class comes and that should be taken into account
* is this:
* </p>
diff --git a/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java b/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
index f6fd3df..e521195 100644
--- a/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
+++ b/api/src/main/java/javax/faces/component/behavior/_DeltaStateHelper.java
@@ -63,10 +63,6 @@ import javax.faces.context.FacesContext;
* and do a clean separation between initial state and delta.
* </p>
* <p>
- * The code from this class comes from a refactor of
- * org.apache.myfaces.trinidad.bean.util.PropertyHashMap
- * </p>
- * <p>
* The context from this class comes and that should be taken into account
* is this:
* </p>
diff --git a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
index 6fe6721..2dea7d5 100644
--- a/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/ResourceHandlerImpl.java
@@ -19,6 +19,7 @@
package org.apache.myfaces.application;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.shared.resource.ResourceHandlerCache;
import org.apache.myfaces.shared.resource.ResourceHandlerCache.ResourceValue;
import org.apache.myfaces.shared.resource.ResourceHandlerSupport;
@@ -510,11 +511,11 @@ public class ResourceHandlerImpl extends ResourceHandler
{
if (resourceName.endsWith(".js"))
{
- return "javax.faces.resource.Script";
+ return ResourceUtils.DEFAULT_SCRIPT_RENDERER_TYPE;
}
else if (resourceName.endsWith(".css"))
{
- return "javax.faces.resource.Stylesheet";
+ return ResourceUtils.DEFAULT_STYLESHEET_RENDERER_TYPE;
}
return null;
}
diff --git a/impl/src/main/java/org/apache/myfaces/application/StateCacheFactory.java b/impl/src/main/java/org/apache/myfaces/application/StateCacheFactory.java
deleted file mode 100644
index 0cdbe39..0000000
--- a/impl/src/main/java/org/apache/myfaces/application/StateCacheFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.application;
-
-import javax.faces.FacesWrapper;
-import javax.faces.context.FacesContext;
-
-/**
- * @deprecated Use org.apache.myfaces.spi.StateCacheProvider instead
- */
-@Deprecated
-public abstract class StateCacheFactory implements FacesWrapper<StateCacheFactory>
-{
- public abstract StateCache getStateCache(FacesContext facesContext);
-
- public StateCacheFactory getWrapped()
- {
- return null;
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java b/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java
index 4f44fde..83382c8 100644
--- a/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/application/viewstate/ServerSideStateCacheImpl.java
@@ -79,20 +79,6 @@ class ServerSideStateCacheImpl extends StateCache<Object, Object>
MyfacesConfig.INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT;
/**
- * Indicate if the state should be serialized before save it on the session.
- * <p>
- * Only applicable if state saving method is "server" (= default).
- * If <code>true</code> (default) the state will be serialized to a byte stream before it is written to the session.
- * If <code>false</code> the state will not be serialized to a byte stream.
- * </p>
- * @deprecated
- */
- @Deprecated
- @JSFWebConfigParam(defaultValue="false",since="1.1", expectedValues="true,false",
- group="state", tags="performance", deprecated=true)
- public static final String SERIALIZE_STATE_IN_SESSION_PARAM = "org.apache.myfaces.SERIALIZE_STATE_IN_SESSION";
-
- /**
* Indicates that the serialized state will be compressed before it is written to the session. By default true.
*
* Only applicable if state saving method is "server" (= default) and if
@@ -506,14 +492,7 @@ class ServerSideStateCacheImpl extends StateCache<Object, Object>
serialize = value.toLowerCase().equals("true");
return serialize;
}
-
- // Fallback old parameter.
- value = context.getExternalContext().getInitParameter(
- SERIALIZE_STATE_IN_SESSION_PARAM);
- if (value != null)
- {
- serialize = Boolean.valueOf(value);
- }
+
return serialize;
}
diff --git a/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationMerger.java b/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationMerger.java
index 299256d..43dd543 100644
--- a/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationMerger.java
+++ b/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationMerger.java
@@ -229,7 +229,7 @@ public class DefaultFacesConfigurationMerger extends FacesConfigurationMerger
}
}
- //add null check for apps which don't have a faces-config.xml (e.g. tomahawk examples for 1.1/1.2)
+ //add null check for apps which don't have a faces-config.xml
if(webAppConfig != null)
{
dispenser.feed(webAppConfig);
diff --git a/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationProvider.java b/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationProvider.java
index 667b7b3..7bd4ec1 100644
--- a/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationProvider.java
+++ b/impl/src/main/java/org/apache/myfaces/config/DefaultFacesConfigurationProvider.java
@@ -63,7 +63,6 @@ import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
import org.apache.myfaces.config.element.FacesFlowDefinition;
import org.apache.myfaces.config.element.facelets.FaceletTagLibrary;
import org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl;
@@ -111,17 +110,6 @@ public class DefaultFacesConfigurationProvider extends FacesConfigurationProvide
FACTORY_NAMES.add(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY);
FACTORY_NAMES.add(FactoryFinder.SEARCH_EXPRESSION_CONTEXT_FACTORY);
}
-
- /**
- * Set of .taglib.xml files, separated by ';' that should be loaded by facelet engine.
- */
- @JSFWebConfigParam(since = "2.0",
- desc = "Set of .taglib.xml files, separated by ';' that should be loaded by facelet engine.",
- deprecated = true)
- private final static String PARAM_LIBRARIES_DEPRECATED = "facelets.LIBRARIES";
-
- private final static String[] PARAMS_LIBRARIES = {ViewHandler.FACELETS_LIBRARIES_PARAM_NAME,
- PARAM_LIBRARIES_DEPRECATED};
private static final Logger log = Logger.getLogger(DefaultFacesConfigurationProvider.class.getName());
@@ -779,7 +767,8 @@ public class DefaultFacesConfigurationProvider extends FacesConfigurationProvide
{
List<FacesConfig> facesConfigFilesList = new ArrayList<FacesConfig>();
- String param = WebConfigParamUtils.getStringInitParameter(externalContext, PARAMS_LIBRARIES);
+ String param = WebConfigParamUtils.getStringInitParameter(externalContext,
+ ViewHandler.FACELETS_LIBRARIES_PARAM_NAME);
if (param != null)
{
for (String library : param.split(";"))
diff --git a/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java b/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
index d96731a..182d9e8 100755
--- a/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
+++ b/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
@@ -18,14 +18,11 @@
*/
package org.apache.myfaces.config;
-import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.net.JarURLConnection;
import java.net.URL;
-import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -121,6 +118,7 @@ import org.apache.myfaces.lifecycle.LifecycleFactoryImpl;
import org.apache.myfaces.renderkit.RenderKitFactoryImpl;
import org.apache.myfaces.renderkit.html.HtmlRenderKitImpl;
import org.apache.myfaces.shared.config.MyfacesConfig;
+import org.apache.myfaces.shared.resource.ResourceLoaderUtils;
import org.apache.myfaces.shared.util.ClassUtils;
import org.apache.myfaces.shared.util.LocaleUtils;
import org.apache.myfaces.shared.util.StateUtils;
@@ -193,10 +191,6 @@ public class FacesConfigurator
*/
public static final String ENABLE_DEFAULT_WINDOW_MODE =
"org.apache.myfaces.ENABLE_DEFAULT_WINDOW_MODE";
-
- private final static String PARAM_FACELETS_LIBRARIES_DEPRECATED = "facelets.LIBRARIES";
- private final static String[] PARAMS_FACELETS_LIBRARIES = {ViewHandler.FACELETS_LIBRARIES_PARAM_NAME,
- PARAM_FACELETS_LIBRARIES_DEPRECATED};
private final ExternalContext _externalContext;
private FacesContext _facesContext;
@@ -294,7 +288,7 @@ public class FacesConfigurator
URL url = _externalContext.getResource(resource);
if (url != null)
{
- return getResourceLastModified(url);
+ return ResourceLoaderUtils.getResourceLastModified(url);
}
}
catch (IOException e)
@@ -304,66 +298,6 @@ public class FacesConfigurator
return 0;
}
- //Taken from trinidad URLUtils
- private long getResourceLastModified(URL url) throws IOException
- {
- if ("file".equals(url.getProtocol()))
- {
- String externalForm = url.toExternalForm();
- // Remove the "file:"
- File file = new File(externalForm.substring(5));
-
- return file.lastModified();
- }
- else
- {
- return getResourceLastModified(url.openConnection());
- }
- }
-
- //Taken from trinidad URLUtils
- private long getResourceLastModified(URLConnection connection) throws IOException
- {
- long modified;
- if (connection instanceof JarURLConnection)
- {
- // The following hack is required to work-around a JDK bug.
- // getLastModified() on a JAR entry URL delegates to the actual JAR file
- // rather than the JAR entry.
- // This opens internally, and does not close, an input stream to the JAR
- // file.
- // In turn, you cannot close it by yourself, because it's internal.
- // The work-around is to get the modification date of the JAR file
- // manually,
- // and then close that connection again.
-
- URL jarFileUrl = ((JarURLConnection) connection).getJarFileURL();
- URLConnection jarFileConnection = jarFileUrl.openConnection();
-
- try
- {
- modified = jarFileConnection.getLastModified();
- }
- finally
- {
- try
- {
- jarFileConnection.getInputStream().close();
- }
- catch (Exception exception)
- {
- // Ignored
- }
- }
- }
- else
- {
- modified = connection.getLastModified();
- }
-
- return modified;
- }
-
private long getLastModifiedTime()
{
long lastModified = 0;
@@ -388,8 +322,8 @@ public class FacesConfigurator
}
// get last modified from .taglib.xml
- String faceletsFiles = WebConfigParamUtils.getStringInitParameter(_externalContext,
- PARAMS_FACELETS_LIBRARIES);
+ String faceletsFiles = WebConfigParamUtils.getStringInitParameter(_externalContext,
+ ViewHandler.FACELETS_LIBRARIES_PARAM_NAME);
if (faceletsFiles != null)
{
String[] faceletFilesList = StringUtils.trim(faceletsFiles.split(";"));
diff --git a/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
index 5ad2ee8..cf2af07 100644
--- a/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/context/servlet/PartialViewContextImpl.java
@@ -55,6 +55,7 @@ import org.apache.myfaces.context.PartialResponseWriterImpl;
import org.apache.myfaces.context.RequestViewContext;
import org.apache.myfaces.renderkit.html.HtmlResponseStateManager;
import org.apache.myfaces.shared.renderkit.JSFAttr;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.shared.util.StringUtils;
public class PartialViewContextImpl extends PartialViewContext
@@ -627,8 +628,8 @@ public class PartialViewContextImpl extends PartialViewContext
for (UIComponent component : list)
{
boolean resourceRendered = false;
- if ("javax.faces.resource.Script".equals(component.getRendererType()) ||
- "javax.faces.resource.Stylesheet".equals(component.getRendererType()))
+ if (ResourceUtils.DEFAULT_SCRIPT_RENDERER_TYPE.equals(component.getRendererType()) ||
+ ResourceUtils.DEFAULT_STYLESHEET_RENDERER_TYPE.equals(component.getRendererType()))
{
String resourceName = (String)
component.getAttributes().get(JSFAttr.NAME_ATTR);
diff --git a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java
index aff1c09..a206ca5 100644
--- a/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java
+++ b/impl/src/main/java/org/apache/myfaces/renderkit/html/HtmlCommandScriptRenderer.java
@@ -187,10 +187,6 @@ public class HtmlCommandScriptRenderer extends HtmlRenderer
HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo, facesContext));
activateActionEvent = reqValue != null && reqValue.equals(clientId)
|| HtmlRendererUtils.isPartialOrBehaviorSubmit(facesContext, clientId);
- if (activateActionEvent)
- {
- RendererUtils.initPartialValidationAndModelUpdate(component, facesContext);
- }
}
if (activateActionEvent)
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
index 1137031..8bc0637 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
@@ -169,9 +169,7 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
private VisitContextFactory _visitContextFactory = null;
private String _checkIdsProductionMode;
-
- private MyfacesConfig _config;
-
+
private ViewPoolProcessor _viewPoolProcessor;
public DefaultFaceletsStateManagementStrategy ()
@@ -183,7 +181,6 @@ public class DefaultFaceletsStateManagementStrategy extends StateManagementStrat
{
_vdlFactory = (ViewDeclarationLanguageFactory)
FactoryFinder.getFactory(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY);
- _config = MyfacesConfig.getCurrentInstance(context.getExternalContext());
_viewPoolProcessor = ViewPoolProcessor.getInstance(context);
}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
index 8ab562d..8cea014 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
@@ -167,55 +167,21 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
public final static String DEFAULT_CHARACTER_ENCODING = "UTF-8";
/**
- * Define the default buffer size value passed to ExternalContext.setResponseBufferResponse() and in a
- * servlet environment to HttpServletResponse.setBufferSize().
- */
- @JSFWebConfigParam(since = "2.0", deprecated = true, classType = "java.lang.Integer")
- private final static String PARAM_BUFFER_SIZE_DEPRECATED = "facelets.BUFFER_SIZE";
-
- private final static String[] PARAMS_BUFFER_SIZE = {ViewHandler.FACELETS_BUFFER_SIZE_PARAM_NAME,
- PARAM_BUFFER_SIZE_DEPRECATED};
-
- //private final static String PARAM_BUILD_BEFORE_RESTORE = "facelets.BUILD_BEFORE_RESTORE";
-
- /**
* Constant used by EncodingHandler to indicate the current encoding of the page being built,
* and indicate which one is the response encoding on getResponseEncoding(FacesContext, String) method.
*/
public final static String PARAM_ENCODING = "facelets.Encoding";
/**
- * Define the period used to refresh the facelet abstract syntax tree from the view definition file.
- *
- * <p>By default is infinite (no active).</p>
- */
- @JSFWebConfigParam(since = "2.0", defaultValue = "-1", deprecated = true)
- public final static String PARAM_REFRESH_PERIOD_DEPRECATED = "facelets.REFRESH_PERIOD";
-
- public final static String[] PARAMS_REFRESH_PERIOD = {ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME,
- PARAM_REFRESH_PERIOD_DEPRECATED};
-
- /**
* Class implementing ResourceResolver interface used to locate facelet resources.
*/
@JSFWebConfigParam(since = "2.0", alias = "facelets.RESOURCE_RESOLVER")
public final static String PARAM_RESOURCE_RESOLVER = "javax.faces.FACELETS_RESOURCE_RESOLVER";
- /**
- * Class implementing ResourceResolver interface used to locate facelet resources.
- */
- @JSFWebConfigParam(since = "2.0", deprecated = true)
- private final static String PARAM_RESOURCE_RESOLVER_DEPRECATED = "facelets.RESOURCE_RESOLVER";
-
- private final static String[] PARAMS_RESOURCE_RESOLVER
- = {PARAM_RESOURCE_RESOLVER, PARAM_RESOURCE_RESOLVER_DEPRECATED};
-
@JSFWebConfigParam(since = "2.1", defaultValue = "false", expectedValues = "true, false", tags = "performance")
private final static String PARAM_MARK_INITIAL_STATE_WHEN_APPLY_BUILD_VIEW
= "org.apache.myfaces.MARK_INITIAL_STATE_WHEN_APPLY_BUILD_VIEW";
- public final static String FILLED_VIEW = "org.apache.myfaces.FILLED_VIEW";
-
//BEGIN CONSTANTS SET ON BUILD VIEW
public final static String BUILDING_VIEW_METADATA = "org.apache.myfaces.BUILDING_VIEW_METADATA";
@@ -2212,20 +2178,20 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
long refreshPeriod;
if (context.isProjectStage(ProjectStage.Production))
{
- refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext, PARAMS_REFRESH_PERIOD,
- DEFAULT_REFRESH_PERIOD_PRODUCTION);
+ refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext,
+ ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME, DEFAULT_REFRESH_PERIOD_PRODUCTION);
}
else
{
- refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext, PARAMS_REFRESH_PERIOD,
- DEFAULT_REFRESH_PERIOD);
+ refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext,
+ ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME, DEFAULT_REFRESH_PERIOD);
}
// resource resolver
ResourceResolver resolver = new DefaultResourceResolver();
ArrayList<String> classNames = new ArrayList<String>();
String faceletsResourceResolverClassName = WebConfigParamUtils.getStringInitParameter(eContext,
- PARAMS_RESOURCE_RESOLVER, null);
+ PARAM_RESOURCE_RESOLVER, null);
List<String> resourceResolversFromAnnotations = RuntimeConfig.getCurrentInstance(
context.getExternalContext()).getResourceResolvers();
if (faceletsResourceResolverClassName != null)
@@ -2615,7 +2581,8 @@ public class FaceletViewDeclarationLanguage extends FaceletViewDeclarationLangua
private void _initializeBuffer(ExternalContext context)
{
- _bufferSize = WebConfigParamUtils.getIntegerInitParameter(context, PARAMS_BUFFER_SIZE, 1024);
+ _bufferSize = WebConfigParamUtils.getIntegerInitParameter(context,
+ ViewHandler.FACELETS_BUFFER_SIZE_PARAM_NAME, 1024);
}
private void _initializeMode(ExternalContext context)
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
index 1e1a3ca..7a36066 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/ViewPoolProcessor.java
@@ -179,7 +179,7 @@ public class ViewPoolProcessor
}
long refreshPeriod = WebConfigParamUtils.getLongInitParameter(context.getExternalContext(),
- FaceletViewDeclarationLanguage.PARAMS_REFRESH_PERIOD,
+ ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME,
FaceletViewDeclarationLanguage.DEFAULT_REFRESH_PERIOD_PRODUCTION);
if (refreshPeriod != -1)
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/FaceletsCompilerSupport.java b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/FaceletsCompilerSupport.java
index ed85faf..cebb749 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/FaceletsCompilerSupport.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/FaceletsCompilerSupport.java
@@ -28,7 +28,6 @@ import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.FacesContextWrapper;
import javax.faces.view.facelets.TagDecorator;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
import org.apache.myfaces.config.RuntimeConfig;
import org.apache.myfaces.config.element.ComponentTagDeclaration;
import org.apache.myfaces.config.element.facelets.FaceletTagLibrary;
@@ -57,26 +56,7 @@ import org.apache.myfaces.view.facelets.util.ReflectionUtil;
public class FaceletsCompilerSupport
{
private static final Logger log = Logger.getLogger(FaceletsCompilerSupport.class.getName());
-
- /**
- * Set of class names, separated by ';', implementing TagDecorator interface, used to transform
- * a view definition in a facelet abstract syntax tree, that is used later to generate a component tree.
- */
- @JSFWebConfigParam(since = "2.0", deprecated = true)
- private final static String PARAM_DECORATORS_DEPRECATED = "facelets.DECORATORS";
-
- private final static String[] PARAMS_DECORATORS = {ViewHandler.FACELETS_DECORATORS_PARAM_NAME,
- PARAM_DECORATORS_DEPRECATED};
-
- /**
- * Skip comments found on a facelet file.
- */
- @JSFWebConfigParam(since = "2.0", deprecated = true)
- private final static String PARAM_SKIP_COMMENTS_DEPRECATED = "facelets.SKIP_COMMENTS";
- private final static String[] PARAMS_SKIP_COMMENTS = {ViewHandler.FACELETS_SKIP_COMMENTS_PARAM_NAME,
- PARAM_SKIP_COMMENTS_DEPRECATED};
-
/**
* Load the various tag libraries for Facelets.
*
@@ -172,7 +152,8 @@ public class FaceletsCompilerSupport
*/
public void loadDecorators(FacesContext context, Compiler compiler)
{
- String param = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(), PARAMS_DECORATORS);
+ String param = WebConfigParamUtils.getStringInitParameter(context.getExternalContext(),
+ ViewHandler.FACELETS_DECORATORS_PARAM_NAME);
if (param != null)
{
for (String decorator : param.split(";"))
@@ -199,7 +180,7 @@ public class FaceletsCompilerSupport
// skip comments?
compiler.setTrimmingComments(WebConfigParamUtils.getBooleanInitParameter(
- eContext, PARAMS_SKIP_COMMENTS, false));
+ eContext, ViewHandler.FACELETS_SKIP_COMMENTS_PARAM_NAME, false));
compiler.setFaceletsProcessingConfigurations(
RuntimeConfig.getCurrentInstance(
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java
index 47e0777..1e93a0f 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/UILeaf.java
@@ -45,6 +45,7 @@ import javax.faces.render.Renderer;
import javax.faces.view.Location;
import org.apache.myfaces.shared.renderkit.html.util.SharedStringBuilder;
+import org.apache.myfaces.shared.util.ComponentUtils;
import org.apache.myfaces.view.facelets.tag.jsf.ComponentSupport;
class UILeaf extends UIComponent implements UntargetableComponent, Map<String, Object>
@@ -82,7 +83,7 @@ class UILeaf extends UIComponent implements UntargetableComponent, Map<String, O
// NamingContainer but UniqueIdVendor is UIViewRoot. Anyway we just can't be 100% sure about this
// fact, so it is better to scan for the closest UniqueIdVendor. If it is not found use
// viewRoot.createUniqueId, otherwise use UniqueIdVendor.createUniqueId(context,seed).
- UniqueIdVendor parentUniqueIdVendor = _ComponentUtils.findParentUniqueIdVendor(this);
+ UniqueIdVendor parentUniqueIdVendor = ComponentUtils.findParentUniqueIdVendor(this);
if (parentUniqueIdVendor == null)
{
UIViewRoot viewRoot = context.getViewRoot();
@@ -109,7 +110,7 @@ class UILeaf extends UIComponent implements UntargetableComponent, Map<String, O
// idWasNull = true;
}
- UIComponent namingContainer = _ComponentUtils.findParentNamingContainer(this, false);
+ UIComponent namingContainer = ComponentUtils.findParentNamingContainer(this, false);
if (namingContainer != null)
{
String containerClientId = namingContainer.getContainerClientId(context);
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/_ComponentUtils.java b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/_ComponentUtils.java
deleted file mode 100755
index 18c9753..0000000
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/_ComponentUtils.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.view.facelets.compiler;
-
-import java.util.Collection;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIInput;
-import javax.faces.component.UIViewRoot;
-import javax.faces.component.UniqueIdVendor;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
-import javax.faces.validator.ValidatorException;
-
-/**
- * A collection of static helper methods for locating UIComponents.
- *
- * @author Manfred Geiler (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-class _ComponentUtils
-{
- private _ComponentUtils()
- {
- }
-
- static UIComponent findParentNamingContainer(UIComponent component, boolean returnRootIfNotFound)
- {
- UIComponent parent = component.getParent();
- if (returnRootIfNotFound && parent == null)
- {
- return component;
- }
- while (parent != null)
- {
- if (parent instanceof NamingContainer)
- {
- return parent;
- }
- if (returnRootIfNotFound)
- {
- UIComponent nextParent = parent.getParent();
- if (nextParent == null)
- {
- return parent; // Root
- }
- parent = nextParent;
- }
- else
- {
- parent = parent.getParent();
- }
- }
- return null;
- }
-
- static UniqueIdVendor findParentUniqueIdVendor(UIComponent component)
- {
- UIComponent parent = component.getParent();
-
- while (parent != null)
- {
- if (parent instanceof UniqueIdVendor)
- {
- return (UniqueIdVendor) parent;
- }
- parent = parent.getParent();
- }
- return null;
- }
-
- static UIComponent getRootComponent(UIComponent component)
- {
- UIComponent parent;
- for (;;)
- {
- parent = component.getParent();
- if (parent == null)
- {
- return component;
- }
- component = parent;
- }
- }
-
- /**
- * Find the component with the specified id starting from the specified component.
- * <p>
- * Param id must not contain any NamingContainer.SEPARATOR_CHAR characters (ie ":"). This method explicitly does
- * <i>not</i> search into any child naming container components; this is expected to be handled by the caller of
- * this method.
- * <p>
- * For an implementation of findComponent which does descend into child naming components, see
- * org.apache.myfaces.custom.util.ComponentUtils.
- *
- * @return findBase, a descendant of findBase, or null.
- */
- static UIComponent findComponent(UIComponent findBase, String id, final char separatorChar)
- {
- if (!(findBase instanceof NamingContainer) && idsAreEqual(id, findBase))
- {
- return findBase;
- }
-
- int facetCount = findBase.getFacetCount();
- if (facetCount > 0)
- {
- for (UIComponent facet : findBase.getFacets().values())
- {
- if (!(facet instanceof NamingContainer))
- {
- UIComponent find = findComponent(facet, id, separatorChar);
- if (find != null)
- {
- return find;
- }
- }
- else if (idsAreEqual(id, facet))
- {
- return facet;
- }
- }
- }
-
- for (int i = 0, childCount = findBase.getChildCount(); i < childCount; i++)
- {
- UIComponent child = findBase.getChildren().get(i);
- if (!(child instanceof NamingContainer))
- {
- UIComponent find = findComponent(child, id, separatorChar);
- if (find != null)
- {
- return find;
- }
- }
- else if (idsAreEqual(id, child))
- {
- return child;
- }
- }
-
- if (findBase instanceof NamingContainer && idsAreEqual(id, findBase))
- {
- return findBase;
- }
-
- return null;
- }
-
- static UIComponent findComponentChildOrFacetFrom(UIComponent parent, String id, String innerExpr)
- {
- if (parent.getFacetCount() > 0)
- {
- for (UIComponent facet : parent.getFacets().values())
- {
- if (id.equals(facet.getId()))
- {
- if (innerExpr == null)
- {
- return facet;
- }
- else if (facet instanceof NamingContainer)
- {
- UIComponent find = facet.findComponent(innerExpr);
- if (find != null)
- {
- return find;
- }
- }
- }
- else if (!(facet instanceof NamingContainer))
- {
- UIComponent find = findComponentChildOrFacetFrom(facet, id, innerExpr);
- if (find != null)
- {
- return find;
- }
- }
- }
- }
- if (parent.getChildCount() > 0)
- {
- for (int i = 0, childCount = parent.getChildCount(); i < childCount; i++)
- {
- UIComponent child = parent.getChildren().get(i);
- if (id.equals(child.getId()))
- {
- if (innerExpr == null)
- {
- return child;
- }
- else if (child instanceof NamingContainer)
- {
- UIComponent find = child.findComponent(innerExpr);
- if (find != null)
- {
- return find;
- }
- }
- }
- else if (!(child instanceof NamingContainer))
- {
- UIComponent find = findComponentChildOrFacetFrom(child, id, innerExpr);
- if (find != null)
- {
- return find;
- }
- }
- }
- }
- return null;
- }
-
- /*
- * Return true if the specified component matches the provided id. This needs some quirks to handle components whose
- * id value gets dynamically "tweaked", eg a UIData component whose id gets the current row index appended to it.
- */
- private static boolean idsAreEqual(String id, UIComponent cmp)
- {
- if (id.equals(cmp.getId()))
- {
- return true;
- }
-
- /* By the spec, findComponent algorithm does not take into account UIData.rowIndex() property,
- * because it just scan over nested plain ids.
- if (cmp instanceof UIData)
- {
- UIData uiData = ((UIData)cmp);
-
- if (uiData.getRowIndex() == -1)
- {
- return dynamicIdIsEqual(id, cmp.getId());
- }
- return id.equals(cmp.getId() + separatorChar + uiData.getRowIndex());
- }
- */
-
- return false;
- }
-
- static void callValidators(FacesContext context, UIInput input, Object convertedValue)
- {
- // first invoke the list of validator components
- Validator[] validators = input.getValidators();
- for (int i = 0; i < validators.length; i++)
- {
- Validator validator = validators[i];
- try
- {
- validator.validate(context, input, convertedValue);
- }
- catch (ValidatorException e)
- {
- input.setValid(false);
-
- String validatorMessage = input.getValidatorMessage();
- if (validatorMessage != null)
- {
- context.addMessage(input.getClientId(context), new FacesMessage(FacesMessage.SEVERITY_ERROR,
- validatorMessage, validatorMessage));
- }
- else
- {
- FacesMessage facesMessage = e.getFacesMessage();
- if (facesMessage != null)
- {
- context.addMessage(input.getClientId(context), facesMessage);
- }
- Collection<FacesMessage> facesMessages = e.getFacesMessages();
- if (facesMessages != null)
- {
- for (FacesMessage message : facesMessages)
- {
- context.addMessage(input.getClientId(context), message);
- }
- }
- }
- }
- }
- }
-
- static String getPathToComponent(UIComponent component)
- {
- StringBuffer buf = new StringBuffer();
-
- if (component == null)
- {
- buf.append("{Component-Path : ");
- buf.append("[null]}");
- return buf.toString();
- }
-
- getPathToComponent(component, buf);
-
- buf.insert(0, "{Component-Path : ");
- buf.append("}");
-
- return buf.toString();
- }
-
- /**
- * Call {@link UIComponent#pushComponentToEL(javax.faces.context.FacesContext,javax.faces.component.UIComponent)},
- * reads the isRendered property, call {@link
- * UIComponent#popComponentFromEL} and returns the value of isRendered.
- */
- static boolean isRendered(FacesContext facesContext, UIComponent uiComponent)
- {
- // We must call pushComponentToEL here because ValueExpression may have
- // implicit object "component" used.
- try
- {
- uiComponent.pushComponentToEL(facesContext, uiComponent);
- return uiComponent.isRendered();
- }
- finally
- {
- uiComponent.popComponentFromEL(facesContext);
- }
- }
-
- private static void getPathToComponent(UIComponent component, StringBuffer buf)
- {
- if (component == null)
- {
- return;
- }
-
- StringBuffer intBuf = new StringBuffer();
-
- intBuf.append("[Class: ");
- intBuf.append(component.getClass().getName());
- if (component instanceof UIViewRoot)
- {
- intBuf.append(",ViewId: ");
- intBuf.append(((UIViewRoot)component).getViewId());
- }
- else
- {
- intBuf.append(",Id: ");
- intBuf.append(component.getId());
- }
- intBuf.append("]");
-
- buf.insert(0, intBuf.toString());
-
- getPathToComponent(component.getParent(), buf);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java
index 35f7716..6c5f8c4 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCacheFactoryImpl.java
@@ -37,11 +37,6 @@ import org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage;
*/
public class FaceletCacheFactoryImpl extends FaceletCacheFactory
{
- private final static String PARAM_REFRESH_PERIOD_DEPRECATED = "facelets.REFRESH_PERIOD";
-
- private final static String[] PARAMS_REFRESH_PERIOD
- = {ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME, PARAM_REFRESH_PERIOD_DEPRECATED};
-
@Override
public FaceletCache getFaceletCache()
@@ -52,12 +47,14 @@ public class FaceletCacheFactoryImpl extends FaceletCacheFactory
long refreshPeriod;
if(context.isProjectStage(ProjectStage.Production))
{
- refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext, PARAMS_REFRESH_PERIOD,
+ refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext,
+ ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME,
FaceletViewDeclarationLanguage.DEFAULT_REFRESH_PERIOD_PRODUCTION);
}
else
{
- refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext, PARAMS_REFRESH_PERIOD,
+ refreshPeriod = WebConfigParamUtils.getLongInitParameter(eContext,
+ ViewHandler.FACELETS_REFRESH_PERIOD_PARAM_NAME,
FaceletViewDeclarationLanguage.DEFAULT_REFRESH_PERIOD);
}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/CompositeFaceletHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/CompositeFaceletHandler.java
deleted file mode 100644
index 54467ba..0000000
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/CompositeFaceletHandler.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.view.facelets.tag;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.FaceletException;
-import javax.faces.view.facelets.FaceletHandler;
-
-/**
- * A FaceletHandler that is derived of 1 or more, inner FaceletHandlers. This class would be found if the next
- * FaceletHandler is structually, a body with multiple child elements as defined in XML.
- *
- * @deprecated use javax.faces.view.facelets.CompositeFaceletHandler
- * @author Jacob Hookom
- * @version $Id$
- */
-public final class CompositeFaceletHandler implements FaceletHandler
-{
-
- private final FaceletHandler[] children;
- private final int len;
-
- public CompositeFaceletHandler(FaceletHandler[] children)
- {
- this.children = children;
- this.len = children.length;
- }
-
- public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
- ELException
- {
- for (int i = 0; i < len; i++)
- {
- this.children[i].apply(ctx, parent);
- }
- }
-
- public FaceletHandler[] getHandlers()
- {
- return this.children;
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/MetaRule.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/MetaRule.java
deleted file mode 100644
index 318be88..0000000
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/MetaRule.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.view.facelets.tag;
-
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
-
-/**
- * A potential rule for Metadata on the passed MetadataTarget
- *
- * See org.apache.myfaces.view.facelets.tag.Metadata
- * See org.apache.myfaces.view.facelets.tag.MetadataTarget
- *
- * @deprecated use javax.faces.view.facelets.MetaRule
- * @author Jacob Hookom
- * @version $Id$
- */
-@Deprecated
-public abstract class MetaRule
-{
-
- /**
- * @param name
- * @param attribute
- * @param meta
- * @return
- */
- public abstract Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta);
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java
deleted file mode 100644
index e919f64..0000000
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.view.facelets.tag.jsf;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.application.Application;
-import javax.faces.component.ActionSource;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIViewRoot;
-import javax.faces.component.ValueHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.MetaTagHandler;
-import javax.faces.view.facelets.TagAttribute;
-import javax.faces.view.facelets.TagException;
-
-import org.apache.myfaces.view.facelets.tag.MetaRulesetImpl;
-
-/**
- * Implementation of the tag logic used in the JSF specification. This is your golden hammer for wiring UIComponents to
- * Facelets.
- *
- * @deprecated Use javax.faces.view.facelets.ComponentHandler instead
- * @author Jacob Hookom
- * @version $Id$
- */
-@Deprecated
-public class ComponentHandler extends MetaTagHandler
-{
-
- //private final static Logger log = Logger.getLogger("facelets.tag.component");
- private final static Logger log = Logger.getLogger(ComponentHandler.class.getName());
-
- private final TagAttribute binding;
-
- private final String componentType;
-
- private final TagAttribute id;
-
- private final String rendererType;
-
- public ComponentHandler(ComponentConfig config)
- {
- super(config);
- this.componentType = config.getComponentType();
- this.rendererType = config.getRendererType();
- this.id = this.getAttribute("id");
- this.binding = this.getAttribute("binding");
- }
-
- /**
- * Method handles UIComponent tree creation in accordance with the JSF 1.2 spec.
- * <ol>
- * <li>First determines this UIComponent's id by calling {@link #getId(FaceletContext) getId(FaceletContext)}.</li>
- * <li>Search the parent for an existing UIComponent of the id we just grabbed</li>
- * <li>If found, markForDeletion(UIComponent) its children for deletion.</li>
- * <li>If <i>not</i> found, call #createComponent(FaceletContext).
- * <ol>
- * <li>Only here do we apply ObjectHandler#setAttributes(FaceletContext, Object)</li>
- * <li>Set the UIComponent's id</li>
- * <li>Set the RendererType of this instance</li>
- * </ol>
- * </li>
- * <li>Now apply the nextHandler, passing the UIComponent we've created/found.</li>
- * <li>Now add the UIComponent to the passed parent</li>
- * <li>Lastly, if the UIComponent already existed (found), then #finalizeForDeletion(UIComponent)
- * for deletion.</li>
- * </ol>
- *
- * See javax.faces.view.facelets.FaceletHandler#apply(javax.faces.view.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- *
- * @throws TagException
- * if the UIComponent parent is null
- */
- public final void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException
- {
- // make sure our parent is not null
- if (parent == null)
- {
- throw new TagException(this.tag, "Parent UIComponent was null");
- }
-
- // possible facet scoped
- String facetName = this.getFacetName(ctx, parent);
-
- // our id
- String id = ctx.generateUniqueId(this.tagId);
-
- // grab our component
- UIComponent c = ComponentSupport.findChildByTagId(parent, id);
- boolean componentFound = false;
- if (c != null)
- {
- componentFound = true;
- // mark all children for cleaning
- if (log.isLoggable(Level.FINE))
- {
- log.fine(this.tag + " Component[" + id + "] Found, marking children for cleanup");
- }
- ComponentSupport.markForDeletion(c);
- }
- else
- {
- c = this.createComponent(ctx);
- if (log.isLoggable(Level.FINE))
- {
- log.fine(this.tag + " Component[" + id + "] Created: " + c.getClass().getName());
- }
- this.setAttributes(ctx, c);
-
- // mark it owned by a facelet instance
- c.getAttributes().put(ComponentSupport.MARK_CREATED, id);
-
- // assign our unique id
- if (this.id != null)
- {
- c.setId(this.id.getValue(ctx));
- }
- else
- {
- UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
- if (root != null)
- {
- String uid = root.createUniqueId();
- c.setId(uid);
- }
- }
-
- if (this.rendererType != null)
- {
- c.setRendererType(this.rendererType);
- }
-
- // hook method
- this.onComponentCreated(ctx, c, parent);
- }
-
- // first allow c to get populated
- this.applyNextHandler(ctx, c);
-
- // finish cleaning up orphaned children
- if (componentFound)
- {
- ComponentSupport.finalizeForDeletion(c);
-
- if (facetName == null)
- {
- parent.getChildren().remove(c);
- }
- }
-
- this.onComponentPopulated(ctx, c, parent);
-
- // add to the tree afterwards
- // this allows children to determine if it's
- // been part of the tree or not yet
- if (facetName == null)
- {
- parent.getChildren().add(c);
- }
- else
- {
- parent.getFacets().put(facetName, c);
- }
- }
-
- /**
- * Return the Facet name we are scoped in, otherwise null
- *
- * @param ctx
- * @return
- */
- protected final String getFacetName(FaceletContext ctx, UIComponent parent)
- {
- // TODO: REFACTOR - "facelets.FACET_NAME" should be a constant somewhere, used to be in FacetHandler
- // from real Facelets
- return (String) parent.getAttributes().get("facelets.FACET_NAME");
- }
-
- /**
- * If the binding attribute was specified, use that in conjuction with our componentType String variable to call
- * createComponent on the Application, otherwise just pass the componentType String. <p> If the binding was used,
- * then set the ValueExpression "binding" on the created UIComponent.</p>
- *
- * See Application#createComponent(javax.faces.el.ValueBinding, javax.faces.context.FacesContext, java.lang.String)
- * See Application#createComponent(java.lang.String)
- * @param ctx
- * FaceletContext to use in creating a component
- * @return
- */
- protected UIComponent createComponent(FaceletContext ctx)
- {
- UIComponent c = null;
- FacesContext faces = ctx.getFacesContext();
- Application app = faces.getApplication();
- if (this.binding != null)
- {
- ValueExpression ve = this.binding.getValueExpression(ctx, Object.class);
-
- c = app.createComponent(ve, faces, this.componentType);
- if (c != null)
- {
- c.setValueExpression("binding", ve);
- }
- }
- else
- {
- c = app.createComponent(this.componentType);
- }
- return c;
- }
-
- /**
- * If the id TagAttribute was specified, get it's value, otherwise generate a unique id from our tagId.
- *
- * See TagAttribute#getValue(FaceletContext)
- * @param ctx
- * FaceletContext to use
- * @return what should be a unique Id
- */
- protected String getId(FaceletContext ctx)
- {
- if (this.id != null)
- {
- return this.id.getValue(ctx);
- }
- return ctx.generateUniqueId(this.tagId);
- }
-
- @Override
- protected MetaRuleset createMetaRuleset(Class type)
- {
- /*MetaRuleset m = super.createMetaRuleset(type);
-
- // ignore standard component attributes
- m.ignore("binding").ignore("id");
-
- // add auto wiring for attributes
- m.addRule(ComponentRule.Instance);
-
- // if it's an ActionSource
- if (ActionSource.class.isAssignableFrom(type))
- {
- m.addRule(ActionSourceRule.Instance);
- }
-
- // if it's a ValueHolder
- if (ValueHolder.class.isAssignableFrom(type))
- {
- m.addRule(ValueHolderRule.Instance);
-
- // if it's an EditableValueHolder
- if (EditableValueHolder.class.isAssignableFrom(type))
- {
- m.ignore("submittedValue");
- m.ignore("valid");
- m.addRule(EditableValueHolderRule.Instance);
- }
- }
-
- return m;*/
-
- // FIXME: Implement correctly
- // temporally restore code
- MetaRuleset m = new MetaRulesetImpl(this.tag, type);
- // ignore standard component attributes
- m.ignore("binding").ignore("id");
-
- // add auto wiring for attributes
- m.addRule(ComponentRule.INSTANCE);
-
- // if it's an ActionSource
- if (ActionSource.class.isAssignableFrom(type))
- {
- m.addRule(ActionSourceRule.INSTANCE);
- }
-
- // if it's a ValueHolder
- if (ValueHolder.class.isAssignableFrom(type))
- {
- m.addRule(ValueHolderRule.INSTANCE);
-
- // if it's an EditableValueHolder
- if (EditableValueHolder.class.isAssignableFrom(type))
- {
- m.ignore("submittedValue");
- m.ignore("valid");
- m.addRule(EditableValueHolderRule.INSTANCE);
- }
- }
-
- return m;
- }
-
- /**
- * A hook method for allowing developers to do additional processing once Facelets creates the component. The
- * 'setAttributes' method is still perferred, but this method will provide the parent UIComponent before it's been
- * added to the tree and before any children have been added to the newly created UIComponent.
- *
- * @param ctx
- * @param c
- * @param parent
- */
- protected void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent)
- {
- // do nothing
- }
-
- protected void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent)
- {
- // do nothing
- }
-
- protected void applyNextHandler(FaceletContext ctx, UIComponent c) throws IOException, FacesException, ELException
- {
- // first allow c to get populated
- this.nextHandler.apply(ctx, c);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
index 95166e4..ab530e7 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentTagHandlerDelegate.java
@@ -57,6 +57,7 @@ import javax.faces.view.facelets.TagException;
import javax.faces.view.facelets.TagHandlerDelegate;
import javax.faces.view.facelets.ValidatorHandler;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.util.ExternalSpecifications;
import org.apache.myfaces.view.facelets.AbstractFaceletContext;
import org.apache.myfaces.view.facelets.ComponentState;
@@ -160,8 +161,8 @@ public class ComponentTagHandlerDelegate extends TagHandlerDelegate
{
// Check if the component is a relocatable component done overriding the tag handler
if (_componentType != null && _rendererType != null &&
- (_rendererType.equals("javax.faces.resource.Script") ||
- _rendererType.equals("javax.faces.resource.Stylesheet")) &&
+ (_rendererType.equals(ResourceUtils.DEFAULT_SCRIPT_RENDERER_TYPE) ||
+ _rendererType.equals(ResourceUtils.DEFAULT_STYLESHEET_RENDERER_TYPE)) &&
_componentType.equals(UIOutput.COMPONENT_TYPE))
{
_relocatableResourceHandler = ComponentRelocatableResourceHandler.INSTANCE;
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConvertHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConvertHandler.java
deleted file mode 100644
index fff4a1c..0000000
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ConvertHandler.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.view.facelets.tag.jsf;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
-import javax.faces.context.FacesContext;
-import javax.faces.convert.Converter;
-import javax.faces.view.facelets.ConverterConfig;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.FaceletException;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.TagAttribute;
-import javax.faces.view.facelets.TagConfig;
-import javax.faces.view.facelets.TagException;
-
-import org.apache.myfaces.view.facelets.tag.MetaTagHandlerImpl;
-
-/**
- * Handles setting a Converter instance on a ValueHolder. Will wire all attributes set to the Converter instance
- * created/fetched. Uses the "binding" attribute for grabbing instances to apply attributes to. <p> Will only
- * set/create Converter is the passed UIComponent's parent is null, signifying that it wasn't restored from an existing
- * tree.</p>
- *
- * See javax.faces.webapp.ConverterELTag
- * See javax.faces.convert.Converter
- * See javax.faces.component.ValueHolder
- *
- * @deprecated use javax.faces.view.facelets.ConverterHandler instead
- * @author Jacob Hookom
- * @version $Id$
- */
-@Deprecated
-public class ConvertHandler extends MetaTagHandlerImpl
-{
-
- private final TagAttribute binding;
-
- private String converterId;
-
- /**
- * @param config
- * @deprecated
- */
- public ConvertHandler(TagConfig config)
- {
- super(config);
- this.binding = this.getAttribute("binding");
- this.converterId = null;
- }
-
- public ConvertHandler(ConverterConfig config)
- {
- this((TagConfig) config);
- this.converterId = config.getConverterId();
- }
-
- /**
- * Set Converter instance on parent ValueHolder if it's not being restored.
- * <ol>
- * <li>Cast to ValueHolder</li>
- * <li>If "binding" attribute was specified, fetch/create and re-bind to expression.</li>
- * <li>Otherwise, call {@link #createConverter(FaceletContext) createConverter}.</li>
- * <li>Call {@link #setAttributes(javax.faces.view.facelets.FaceletContext, java.lang.Object)}
- * on Converter instance.</li>
- * <li>Set the Converter on the ValueHolder</li>
- * <li>If the ValueHolder has a localValue, convert it and set the value</li>
- * </ol>
- *
- * See ValueHolder
- * See Converter
- * See #createConverter(FaceletContext)
- * See javax.faces.view.facelets.FaceletHandler#apply(javax.faces.view.facelets.FaceletContext,
- * javax.faces.component.UIComponent)
- */
- public final void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException,
- FaceletException, ELException
- {
- if (parent == null || !(parent instanceof ValueHolder))
- {
- throw new TagException(this.tag, "Parent not an instance of ValueHolder: " + parent);
- }
-
- // only process if it's been created
- if (parent.getParent() == null)
- {
- // cast to a ValueHolder
- ValueHolder vh = (ValueHolder) parent;
- ValueExpression ve = null;
- Converter c = null;
- if (this.binding != null)
- {
- ve = this.binding.getValueExpression(ctx, Converter.class);
- c = (Converter) ve.getValue(ctx);
- }
- if (c == null)
- {
- c = this.createConverter(ctx);
- if (ve != null)
- {
- ve.setValue(ctx, c);
- }
- }
- if (c == null)
- {
- throw new TagException(this.tag, "No Converter was created");
- }
- this.setAttributes(ctx, c);
- vh.setConverter(c);
- Object lv = vh.getLocalValue();
- FacesContext faces = ctx.getFacesContext();
- if (lv instanceof String)
- {
- vh.setValue(c.getAsObject(faces, parent, (String) lv));
- }
- }
- }
-
- /**
- * Create a Converter instance
- *
- * @param ctx
- * FaceletContext to use
- * @return Converter instance, cannot be null
- */
- protected Converter createConverter(FaceletContext ctx)
- {
- if (this.converterId == null)
- {
- throw new TagException(this.tag,
- "Default behavior invoked of requiring a converter-id passed in the constructor, "
- + "must override ConvertHandler(ConverterConfig)");
- }
- return ctx.getFacesContext().getApplication().createConverter(this.converterId);
- }
-
- protected MetaRuleset createMetaRuleset(Class type)
- {
- return super.createMetaRuleset(type).ignore("binding");
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidateHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidateHandler.java
deleted file mode 100644
index b540b3d..0000000
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidateHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.view.facelets.tag.jsf;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.el.ValueExpression;
-import javax.faces.FacesException;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.UIComponent;
-import javax.faces.validator.Validator;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.FaceletException;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.TagAttribute;
-import javax.faces.view.facelets.TagConfig;
-import javax.faces.view.facelets.TagException;
-import javax.faces.view.facelets.ValidatorConfig;
-
-import org.apache.myfaces.view.facelets.tag.MetaTagHandlerImpl;
-
-/**
- * Handles setting a Validator instance on a EditableValueHolder. Will wire all attributes set to the Validator instance
- * created/fetched. Uses the "binding" attribute for grabbing instances to apply attributes to. <p> Will only
- * set/create Validator is the passed UIComponent's parent is null, signifying that it wasn't restored from an existing
- * tree.</p>
- *
- * @deprecated use javax.faces.view.facelets.ValidatorHandler instead
- * @author Jacob Hookom
- * @version $Id$
- */
-@Deprecated
-public class ValidateHandler extends MetaTagHandlerImpl
-{
-
- private final TagAttribute binding;
-
- private String validatorId;
-
- /**
- *
- * @param config
- * @deprecated
- */
- public ValidateHandler(TagConfig config)
- {
- super(config);
- this.binding = this.getAttribute("binding");
- }
-
- public ValidateHandler(ValidatorConfig config)
- {
- this((TagConfig) config);
- this.validatorId = config.getValidatorId();
- }
-
- /**
- *
- * See javax.faces.view.facelets.FaceletHandler#apply(
- * javax.faces.view.facelets.FaceletContext, javax.faces.component.UIComponent)
- */
- public final void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException,
- FaceletException, ELException
- {
-
- if (parent == null || !(parent instanceof EditableValueHolder))
- {
- throw new TagException(this.tag, "Parent not an instance of EditableValueHolder: " + parent);
- }
-
- // only process if it's been created
- if (parent.getParent() == null)
- {
- // cast to a ValueHolder
- EditableValueHolder evh = (EditableValueHolder) parent;
- ValueExpression ve = null;
- Validator v = null;
- if (this.binding != null)
- {
- ve = this.binding.getValueExpression(ctx, Validator.class);
- v = (Validator) ve.getValue(ctx);
- }
- if (v == null)
- {
- v = this.createValidator(ctx);
- if (ve != null)
- {
- ve.setValue(ctx, v);
- }
- }
- if (v == null)
- {
- throw new TagException(this.tag, "No Validator was created");
- }
- this.setAttributes(ctx, v);
- evh.addValidator(v);
- }
- }
-
- /**
- * Template method for creating a Validator instance
- *
- * @param ctx
- * FaceletContext to use
- * @return a new Validator instance
- */
- protected Validator createValidator(FaceletContext ctx)
- {
- if (this.validatorId == null)
- {
- throw new TagException(
- this.tag,
- "Default behavior invoked of requiring a validator-id passed in the "
- + "constructor, must override ValidateHandler(ValidatorConfig)");
- }
- return ctx.getFacesContext().getApplication().createValidator(this.validatorId);
- }
-
- protected MetaRuleset createMetaRuleset(Class type)
- {
- return super.createMetaRuleset(type).ignore("binding");
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
index 22069bf..fdfdf9f 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AjaxHandler.java
@@ -48,6 +48,7 @@ import javax.faces.view.facelets.TagHandler;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletAttribute;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFaceletTag;
import org.apache.myfaces.shared.renderkit.JSFAttr;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.view.facelets.AbstractFaceletContext;
import org.apache.myfaces.view.facelets.FaceletCompositionContext;
import org.apache.myfaces.view.facelets.tag.TagHandlerUtils;
@@ -277,7 +278,7 @@ public class AjaxHandler extends TagHandler implements
if (!facesContext.getAttributes().containsKey(STANDARD_JSF_AJAX_LIBRARY_LOADED))
{
UIComponent outputScript = facesContext.getApplication().
- createComponent(facesContext, "javax.faces.Output", "javax.faces.resource.Script");
+ createComponent(facesContext, "javax.faces.Output", ResourceUtils.DEFAULT_SCRIPT_RENDERER_TYPE);
outputScript.getAttributes().put(JSFAttr.NAME_ATTR, ResourceHandler.JSF_SCRIPT_RESOURCE_NAME);
outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
outputScript.getAttributes().put(JSFAttr.TARGET_ATTR, "head");
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/util/FaceletsViewDeclarationLanguageUtils.java b/impl/src/main/java/org/apache/myfaces/view/facelets/util/FaceletsViewDeclarationLanguageUtils.java
index 956858d..e1b24f0 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/util/FaceletsViewDeclarationLanguageUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/util/FaceletsViewDeclarationLanguageUtils.java
@@ -25,6 +25,7 @@ import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import org.apache.myfaces.shared.renderkit.JSFAttr;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.shared.util.ClassUtils;
/**
@@ -125,8 +126,8 @@ public class FaceletsViewDeclarationLanguageUtils
{
for (UIComponent component : componentResources)
{
- if ("javax.faces.resource.Script".equals(component.getRendererType()) ||
- "javax.faces.resource.Stylesheet".equals(component.getRendererType()))
+ if (ResourceUtils.DEFAULT_SCRIPT_RENDERER_TYPE.equals(component.getRendererType()) ||
+ ResourceUtils.DEFAULT_STYLESHEET_RENDERER_TYPE.equals(component.getRendererType()))
{
String resourceName = (String) component.getAttributes().get(JSFAttr.NAME_ATTR);
String libraryName = (String) component.getAttributes().get(JSFAttr.LIBRARY_ATTR);
diff --git a/impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java b/impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java
index e563339..6d4962b 100644
--- a/impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java
+++ b/impl/src/main/java/org/apache/myfaces/webapp/AbstractFacesInitializer.java
@@ -215,9 +215,7 @@ public abstract class AbstractFacesInitializer implements FacesInitializer
}
WebConfigParamsLogger.logWebContextParams(facesContext);
-
- checkForDeprecatedContextParams(facesContext);
-
+
//Force output EL message
ExternalSpecifications.isBeanValidationAvailable();
@@ -768,55 +766,5 @@ public abstract class AbstractFacesInitializer implements FacesInitializer
}
return facesServletRegistration;
}
-
- protected void checkForDeprecatedContextParams(FacesContext facesContext)
- {
- ExternalContext externalContext = facesContext.getExternalContext();
-
- String value;
-
- value = externalContext.getInitParameter("org.apache.myfaces.CDI_MANAGED_CONVERTERS_ENABLED");
- if (value != null && !value.isEmpty())
- {
- log.severe("'org.apache.myfaces.CDI_MANAGED_CONVERTERS_ENABLED' is not supported anymore since 2.3. "
- + "Please use @FacesConverter with managed=true.");
- }
-
- value = externalContext.getInitParameter("org.apache.myfaces.CDI_MANAGED_VALIDATORS_ENABLED");
- if (value != null && !value.isEmpty())
- {
- log.severe("'org.apache.myfaces.CDI_MANAGED_VALIDATORS_ENABLED' is not supported anymore since 2.3. "
- + "Please use @FacesValidator with managed=true.");
- }
-
- value = externalContext.getInitParameter("org.apache.myfaces.SAVE_STATE_WITH_VISIT_TREE_ON_PSS");
- if (value != null && !value.isEmpty())
- {
- log.severe("'org.apache.myfaces.SAVE_STATE_WITH_VISIT_TREE_ON_PSS' is not supported anymore since 2.3.");
- }
-
- value = externalContext.getInitParameter("org.apache.myfaces.CACHE_OLD_VIEWS_IN_SESSION_MODE");
- if (value != null && !value.isEmpty())
- {
- log.severe("'org.apache.myfaces.CACHE_OLD_VIEWS_IN_SESSION_MODE' is not supported anymore since 2.3.");
- }
-
- value = externalContext.getInitParameter("org.apache.myfaces.HANDLE_STATE_CACHING_MECHANICS");
- if (value != null && !value.isEmpty())
- {
- log.severe("'org.apache.myfaces.HANDLE_STATE_CACHING_MECHANICS' is not supported anymore since 2.3.");
- }
-
- value = externalContext.getInitParameter("org.apache.myfaces.ERROR_HANDLER");
- if (value != null && !value.isEmpty())
- {
- log.severe("'org.apache.myfaces.ERROR_HANDLER' is not supported anymore since 2.3.");
- }
-
- value = externalContext.getInitParameter("org.apache.myfaces.STRICT_JSF_2_REFRESH_TARGET_AJAX");
- if (value != null && !value.isEmpty())
- {
- log.severe("'org.apache.myfaces.STRICT_JSF_2_REFRESH_TARGET_AJAX' is not supported anymore since 2.3.");
- }
- }
+
}
diff --git a/impl/src/main/resources/META-INF/WebConfigParamsLogger.vm b/impl/src/main/resources/META-INF/WebConfigParamsLogger.vm
index fa504cc..2f4a189 100644
--- a/impl/src/main/resources/META-INF/WebConfigParamsLogger.vm
+++ b/impl/src/main/resources/META-INF/WebConfigParamsLogger.vm
@@ -37,51 +37,25 @@ public class WebConfigParamsLogger
public static void logWebContextParams(FacesContext facesContext)
{
String logCommand = WebConfigParamUtils.getStringInitParameter(
- facesContext.getExternalContext(),
+ facesContext.getExternalContext(),
AbstractFacesInitializer.INIT_PARAM_LOG_WEB_CONTEXT_PARAMS, AbstractFacesInitializer.INIT_PARAM_LOG_WEB_CONTEXT_PARAMS_DEFAULT);
-
- if ( logCommand.equals("false") ||
+
+ if ( logCommand.equals("false") ||
(logCommand.equals("auto") && !facesContext.isProjectStage(ProjectStage.Development) && !facesContext.isProjectStage(ProjectStage.Production) )
)
{
//No log if is disabled or is in auto mode and project stage is UnitTest or SystemTest
return;
}
-
- MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(facesContext.getExternalContext());
-
- if (myfacesConfig.isTomahawkAvailable())
- {
- if(myfacesConfig.isMyfacesImplAvailable())
- {
- if(log.isLoggable(Level.INFO))
- {
- log.info("Starting up Tomahawk on the MyFaces-JSF-Implementation");
- }
- }
- if(myfacesConfig.isRiImplAvailable())
- {
- if(log.isLoggable(Level.INFO))
- {
- log.info("Starting up Tomahawk on the RI-JSF-Implementation.");
- }
- }
- }
- else
- {
- if (log.isLoggable(Level.INFO))
- {
- log.info("Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now.");
- }
- }
+ MyfacesConfig myfacesConfig = MyfacesConfig.getCurrentInstance(facesContext.getExternalContext());
if(myfacesConfig.isRiImplAvailable() && myfacesConfig.isMyfacesImplAvailable())
{
log.severe("Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.");
}
-
-
+
+
## ----------------------------- PROPERTY MACROS -----------------------------
##
## -------------------------------
@@ -106,7 +80,7 @@ public class WebConfigParamsLogger
if (paramValue.equalsIgnoreCase(expectedValues[i]))
#else
if (paramValue.equals(expectedValues[i]))
-#end
+#end
{
found = true;
break;
@@ -115,7 +89,7 @@ public class WebConfigParamsLogger
if (!found)
{
if (log.isLoggable(Level.WARNING))
- {
+ {
log.warning("Wrong value in context init parameter '$webConfigParam.name' (='" + paramValue + "'), using default value #if($webConfigParam.defaultValue)'$webConfigParam.defaultValue'#else'null'#end");
}
}
@@ -156,26 +130,11 @@ public class WebConfigParamsLogger
#if (not $webConfigParam.containsTag('tomahawk'))
#writePropertyCheck($webConfigParam)
-#end
#end
#end
#end
- }
-##
- if (log.isLoggable(Level.INFO) && myfacesConfig.isTomahawkAvailable())
- {
- String paramValue = null;
-#foreach( $webConfig in $webConfigList )
-#if ($modelIds.contains($webConfig.modelId))
-#set ($webConfigParamList = ${webConfig.getWebConfigParametersList()})
-#foreach( $webConfigParam in $webConfigParamList )
-#if ($webConfigParam.containsTag('tomahawk'))
-
-#writePropertyCheck($webConfigParam)
-#end
-#end
-#end
#end
}
+##
}
}
diff --git a/impl/src/test/java/org/apache/myfaces/test/AbstractClassElementTestCase.java b/impl/src/test/java/org/apache/myfaces/test/AbstractClassElementTestCase.java
index 05e8298..1e7181d 100644
--- a/impl/src/test/java/org/apache/myfaces/test/AbstractClassElementTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/test/AbstractClassElementTestCase.java
@@ -31,10 +31,7 @@ import org.apache.myfaces.shared.test.ClassElementHandler;
/**
* This test makes sure all of our components, tags, renderers, validators, converters, action listeners, phase
* listeners and core implementation classes are in the build.
- *
- * This class has been copy and pasted into both tomahawk and core in order to avoid a compile scoped dependency on
- * junit in shared.
- *
+ *
* @see ClassElementHandler
* @author Dennis Byrne
*/
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletMultipleRequestsTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletMultipleRequestsTestCase.java
index a9b7da5..5c4c684 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletMultipleRequestsTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletMultipleRequestsTestCase.java
@@ -85,7 +85,6 @@ public abstract class FaceletMultipleRequestsTestCase extends AbstractJsfConfigu
servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT","true");
servletContext.addInitParameter("org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON","false");
servletContext.addInitParameter("org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE","false");
- servletContext.addInitParameter("org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS","true");
servletContext.addInitParameter("org.apache.myfaces.RENDER_VIEWSTATE_ID","true");
servletContext.addInitParameter("org.apache.myfaces.STRICT_XHTML_LINKS","true");
servletContext.addInitParameter("org.apache.myfaces.CONFIG_REFRESH_PERIOD","0");
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java
index 096ff93..9bb1e41 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java
@@ -84,7 +84,6 @@ public abstract class FaceletTestCase extends AbstractJsfConfigurableMockTestCas
servletContext.addInitParameter("org.apache.myfaces.ALLOW_JAVASCRIPT","true");
servletContext.addInitParameter("org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON","false");
servletContext.addInitParameter("org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE","false");
- servletContext.addInitParameter("org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS","true");
servletContext.addInitParameter("org.apache.myfaces.RENDER_VIEWSTATE_ID","true");
servletContext.addInitParameter("org.apache.myfaces.STRICT_XHTML_LINKS","true");
servletContext.addInitParameter("org.apache.myfaces.CONFIG_REFRESH_PERIOD","0");
diff --git a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jsf/html/DefaultHtmlDecoratorTestCase.java b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jsf/html/DefaultHtmlDecoratorTestCase.java
index 807536e..118e996 100644
--- a/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jsf/html/DefaultHtmlDecoratorTestCase.java
+++ b/impl/src/test/java/org/apache/myfaces/view/facelets/tag/jsf/html/DefaultHtmlDecoratorTestCase.java
@@ -47,6 +47,7 @@ import javax.faces.view.facelets.Tag;
import javax.faces.view.facelets.TagAttribute;
import javax.faces.view.facelets.TagDecorator;
import org.apache.myfaces.shared.renderkit.html.HtmlResponseWriterImpl;
+import org.apache.myfaces.shared.renderkit.html.util.ResourceUtils;
import org.apache.myfaces.test.utils.HtmlCheckAttributesUtil;
import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.myfaces.view.facelets.FaceletTestCase;
@@ -113,12 +114,12 @@ public class DefaultHtmlDecoratorTestCase extends FaceletTestCase
{
if (child instanceof UIOutput)
{
- if ("javax.faces.resource.Script".equals(child.getRendererType()))
+ if (ResourceUtils.DEFAULT_SCRIPT_RENDERER_TYPE.equals(child.getRendererType()))
{
Assert.assertEquals("osc", child.getId());
scriptsFound++;
}
- if ("javax.faces.resource.Stylesheet".equals(child.getRendererType()))
+ if (ResourceUtils.DEFAULT_STYLESHEET_RENDERER_TYPE.equals(child.getRendererType()))
{
Assert.assertEquals("osh", child.getId());
linksFound++;
diff --git a/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java b/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java
index f8ef8fc..0252c71 100644
--- a/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java
+++ b/shared-public/src/main/java/org/apache/myfaces/shared/util/ComponentUtils.java
@@ -21,6 +21,7 @@ package org.apache.myfaces.shared.util;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
+import javax.faces.component.UniqueIdVendor;
/**
*
@@ -77,4 +78,19 @@ public class ComponentUtils
}
return null;
}
+
+ public static UniqueIdVendor findParentUniqueIdVendor(UIComponent component)
+ {
+ UIComponent parent = component.getParent();
+
+ while (parent != null)
+ {
+ if (parent instanceof UniqueIdVendor)
+ {
+ return (UniqueIdVendor) parent;
+ }
+ parent = parent.getParent();
+ }
+ return null;
+ }
}
diff --git a/shared-public/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java b/shared-public/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java
index 252760e..61a8573 100644
--- a/shared-public/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java
+++ b/shared-public/src/main/java/org/apache/myfaces/shared/util/SelectItemsIterator.java
@@ -21,6 +21,7 @@ package org.apache.myfaces.shared.util;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
@@ -53,7 +54,7 @@ public class SelectItemsIterator implements Iterator<SelectItem>
private static final String ITEM_LABEL_ESCAPED_PROP = JsfProperties.ITEM_LABEL_ESCAPED_PROP;
private static final String NO_SELECTION_VALUE_PROP = JsfProperties.NO_SELECTION_VALUE_PROP;
- private static final Iterator<UIComponent> _EMPTY_UICOMPONENT_ITERATOR = new _EmptyIterator<UIComponent>();
+ private static final Iterator<UIComponent> _EMPTY_UICOMPONENT_ITERATOR = Collections.<UIComponent>emptyIterator();
private final Iterator<UIComponent> _children;
private Iterator<? extends Object> _nestedItems;
diff --git a/shared-public/src/main/java/org/apache/myfaces/shared/util/_EmptyIterator.java b/shared-public/src/main/java/org/apache/myfaces/shared/util/_EmptyIterator.java
deleted file mode 100644
index 6ad32ef..0000000
--- a/shared-public/src/main/java/org/apache/myfaces/shared/util/_EmptyIterator.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.shared.util;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-class _EmptyIterator<T> implements Iterator<T>
-{
-
- public boolean hasNext()
- {
- return false;
- }
-
- public T next()
- {
- throw new NoSuchElementException();
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java b/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
index f3dbc35..b6657cc 100755
--- a/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/config/MyfacesConfig.java
@@ -22,7 +22,6 @@ package org.apache.myfaces.shared.config;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.context.ExternalContext;
-import javax.servlet.ServletContext;
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
import org.apache.myfaces.shared.util.ClassUtils;
@@ -46,14 +45,6 @@ public class MyfacesConfig
private static final String APPLICATION_MAP_PARAM_NAME = MyfacesConfig.class.getName();
/**
- * Set the virtual path used to serve resources using tomahawk addResource API. Note ExtensionsFilter should
- * be able to receive request on the prefix used here.
- */
- @JSFWebConfigParam(tags="tomahawk")
- public static final String INIT_PARAM_RESOURCE_VIRTUAL_PATH = "org.apache.myfaces.RESOURCE_VIRTUAL_PATH";
- public static final String INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT = "/faces/myFacesExtensionResource";
-
- /**
* If true, rendered HTML code will be formatted, so that it is "human readable".
* i.e. additional line separators and whitespace will be written, that do not
* influence the HTML code. Default: "true"
@@ -64,84 +55,6 @@ public class MyfacesConfig
private static final boolean INIT_PARAM_PRETTY_HTML_DEFAULT = true;
/**
- * This parameter tells MyFaces if javascript code should be allowed in the rendered HTML output.
- * If javascript is allowed, command_link anchors will have javascript code
- * that submits the corresponding form.
- * If javascript is not allowed, the state saving info and nested parameters ill be
- * added as url parameters.
- * Default: "true"
- */
- @JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1",
- ignoreUpperLowerCase=true, group="render")
- private static final String INIT_PARAM_ALLOW_JAVASCRIPT = "org.apache.myfaces.ALLOW_JAVASCRIPT";
- private static final boolean INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT = true;
-
- /**
- * Deprecated: tomahawk specific param to detect javascript, but it is no longer valid anymore.
- */
- @JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.1",
- ignoreUpperLowerCase=true, deprecated=true, tags="tomahawk", group="render")
- private static final String INIT_PARAM_DETECT_JAVASCRIPT = "org.apache.myfaces.DETECT_JAVASCRIPT";
- private static final boolean INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT = false;
-
- /**
- * If true, a javascript function will be rendered that is able to restore the
- * former vertical scroll on every request. Convenient feature if you have pages
- * with long lists and you do not want the browser page to always jump to the top
- * if you trigger a link or button action that stays on the same page.
- * Default: "false"
- */
- @JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.1",
- ignoreUpperLowerCase=true, tags="tomahawk")
- private static final String INIT_PARAM_AUTO_SCROLL = "org.apache.myfaces.AUTO_SCROLL";
- private static final boolean INIT_PARAM_AUTO_SCROLL_DEFAULT = false;
-
- /**
- * Tomahawk specific: A class implementing the
- * org.apache.myfaces.shared.renderkit.html.util.AddResource
- * interface. It is responsible to
- * place scripts and css on the right position in your HTML document.
- * Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
- * Follow the description on the MyFaces-Wiki-Performance page to enable
- * StreamingAddResource instead of DefaultAddResource if you want to
- * gain performance.
- */
- @JSFWebConfigParam(defaultValue="org.apache.myfaces. renderkit.html.util. DefaultAddResource",since="1.1",
- desc="Tomahawk specific: Indicate the class responsible to place scripts and css using " +
- "tomahawk AddResource API", tags="tomahawk")
- private static final String INIT_PARAM_ADD_RESOURCE_CLASS = "org.apache.myfaces.ADD_RESOURCE_CLASS";
- private static final String INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT =
- "org.apache.myfaces.renderkit.html.util.DefaultAddResource";
-
- /**
- * Tomahawk specific: A very common problem in configuring MyFaces-web-applications
- * is that the Extensions-Filter is not configured at all
- * or improperly configured. This parameter will check for a properly
- * configured Extensions-Filter if it is needed by the web-app.
- * In most cases this check will work just fine, there might be cases
- * where an internal forward will bypass the Extensions-Filter and the check
- * will not work. If this is the case, you can disable the check by setting
- * this parameter to false.
- *
- * In tomahawk for JSF 2.0 since version 1.1.11, this param is set by default to false, otherwise is true.
- */
- @JSFWebConfigParam(defaultValue="for JSF 2.0 since 1.1.11 false, otherwise true",
- expectedValues="true, false, on, off, yes, no",since="1.1", ignoreUpperLowerCase=true,
- desc="Tomahawk specific: This parameter will check for a properly configured Extensions-Filter if " +
- "it is needed by the web-app.", tags="tomahawk")
- private static final String INIT_CHECK_EXTENSIONS_FILTER = "org.apache.myfaces.CHECK_EXTENSIONS_FILTER";
- private static final boolean INIT_CHECK_EXTENSIONS_FILTER_DEFAULT = false;
-
- /**
- * Tomahawk specific: Interpret "readonly" property as "disable" for select components like t:selectOneRow.
- */
- @JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1",
- ignoreUpperLowerCase=true, tags="tomahawk", group="render")
- private static final String INIT_READONLY_AS_DISABLED_FOR_SELECT =
- "org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS";
- private static final boolean INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT = true;
-
- /**
* Set the time in seconds that check for updates of web.xml and faces-config descriptors and
* refresh the configuration.
* This param is valid only if project stage is not production. Set this param to 0 disable this feature.
@@ -530,13 +443,6 @@ public class MyfacesConfig
public final static boolean STRICT_JSF_2_ORIGIN_HEADER_APP_PATH_DEFAULT = false;
private boolean _prettyHtml;
- private boolean _detectJavascript;
- private boolean _allowJavascript;
- private boolean _autoScroll;
- private String _addResourceClass;
- private String _resourceVirtualPath;
- private boolean _checkExtensionsFilter;
- private boolean _readonlyAsDisabledForSelect;
private long _configRefreshPeriod;
private boolean _viewStateJavascript;
private boolean _renderViewStateId;
@@ -571,27 +477,11 @@ public class MyfacesConfig
private boolean _supportEL3ImportHandler;
private boolean _strictJsf2OriginHeaderAppPath;
- private static final boolean TOMAHAWK_AVAILABLE;
private static final boolean MYFACES_IMPL_AVAILABLE;
private static final boolean RI_IMPL_AVAILABLE;
static
{
- boolean tomahawkAvailable;
- try
- {
- ClassUtils.classForName("org.apache.myfaces.webapp.filter.ExtensionsFilter");
- tomahawkAvailable = true;
- }
- catch (ClassNotFoundException e)
- {
- tomahawkAvailable = false;
- }
- TOMAHAWK_AVAILABLE = tomahawkAvailable;
- }
-
- static
- {
boolean myfacesImplAvailable;
try
{
@@ -639,11 +529,9 @@ public class MyfacesConfig
public MyfacesConfig()
{
setPrettyHtml(INIT_PARAM_PRETTY_HTML_DEFAULT);
- setAllowJavascript(INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT);
setRenderClearJavascriptOnButton(INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT);
setRenderHiddenFieldsForLinkParams(INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT);
setSaveFormSubmitLinkIE(INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT);
- setReadonlyAsDisabledForSelect(INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT);
setRenderViewStateId(INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT);
setStrictXhtmlLinks(INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT);
setConfigRefreshPeriod(INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT);
@@ -653,13 +541,6 @@ public class MyfacesConfig
setRefreshTransientBuildOnPSSPreserveState(INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT);
setValidateXML(INIT_PARAM_VALIDATE_XML_DEFAULT);
setWrapScriptContentWithXmlCommentTag(INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT);
- setDetectJavascript(INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT);
- setAutoScroll(INIT_PARAM_AUTO_SCROLL_DEFAULT);
- setAddResourceClass(INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT);
- setResourceVirtualPath(INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT);
- //The default is true but we'll let it false because it depends if
- //tomahawk is on classpath and no test environment is set
- setCheckExtensionsFilter(false);
setRenderFormSubmitScriptInline(INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE_DEFAULT);
setDebugPhaseListenerEnabled(INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT);
setStrictJsf2CCELResolver(INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER_DEFAULT);
@@ -690,8 +571,6 @@ public class MyfacesConfig
myfacesConfig.setPrettyHtml(getBooleanInitParameter(extCtx, INIT_PARAM_PRETTY_HTML,
INIT_PARAM_PRETTY_HTML_DEFAULT));
- myfacesConfig.setAllowJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_ALLOW_JAVASCRIPT,
- INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT));
myfacesConfig.setRenderClearJavascriptOnButton(getBooleanInitParameter(extCtx,
INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON,
@@ -703,10 +582,7 @@ public class MyfacesConfig
myfacesConfig.setSaveFormSubmitLinkIE(getBooleanInitParameter(extCtx, INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE,
INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT));
-
- myfacesConfig.setReadonlyAsDisabledForSelect(getBooleanInitParameter(extCtx,
- INIT_READONLY_AS_DISABLED_FOR_SELECT,
- INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT));
+
myfacesConfig.setRenderViewStateId(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_VIEWSTATE_ID,
INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT));
myfacesConfig.setStrictXhtmlLinks(getBooleanInitParameter(extCtx, INIT_PARAM_STRICT_XHTML_LINKS,
@@ -877,54 +753,7 @@ public class MyfacesConfig
myfacesConfig.setStrictJsf2OriginHeaderAppPath(WebConfigParamUtils.getBooleanInitParameter(extCtx,
STRICT_JSF_2_ORIGIN_HEADER_APP_PATH,
STRICT_JSF_2_ORIGIN_HEADER_APP_PATH_DEFAULT));
-
- if (TOMAHAWK_AVAILABLE)
- {
- myfacesConfig.setDetectJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_DETECT_JAVASCRIPT,
- INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT));
- myfacesConfig.setAutoScroll(getBooleanInitParameter(extCtx, INIT_PARAM_AUTO_SCROLL,
- INIT_PARAM_AUTO_SCROLL_DEFAULT));
-
- myfacesConfig.setAddResourceClass(getStringInitParameter(extCtx, INIT_PARAM_ADD_RESOURCE_CLASS,
- INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT));
- myfacesConfig.setResourceVirtualPath(getStringInitParameter(extCtx, INIT_PARAM_RESOURCE_VIRTUAL_PATH,
- INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT));
-
- myfacesConfig.setCheckExtensionsFilter(getBooleanInitParameter(extCtx, INIT_CHECK_EXTENSIONS_FILTER,
- INIT_CHECK_EXTENSIONS_FILTER_DEFAULT));
- /*
- if(RI_IMPL_AVAILABLE)
- {
- if(log.isLoggable(Level.INFO))
- {
- log.info("Starting up Tomahawk on the RI-JSF-Implementation.");
- }
- }
-
- if(MYFACES_IMPL_AVAILABLE)
- {
- if(log.isLoggable(Level.INFO))
- {
- log.info("Starting up Tomahawk on the MyFaces-JSF-Implementation");
- }
- }*/
- }
- /*
- else
- {
- if (log.isLoggable(Level.INFO))
- {
- log.info("Tomahawk jar not available. Autoscrolling, DetectJavascript, "+
- "AddResourceClass and CheckExtensionsFilter are disabled now.");
- }
- }*/
- /*
- if(RI_IMPL_AVAILABLE && MYFACES_IMPL_AVAILABLE)
- {
- log.severe("Both MyFaces and the RI are on your classpath. Please make sure to"+
- " use only one of the two JSF-implementations.");
- }*/
return myfacesConfig;
}
@@ -998,16 +827,6 @@ public class MyfacesConfig
return defaultValue;
}
}
-
- private void setResourceVirtualPath( String resourceVirtualPath )
- {
- this._resourceVirtualPath = resourceVirtualPath;
- }
-
- public String getResourceVirtualPath()
- {
- return this._resourceVirtualPath;
- }
public boolean isPrettyHtml()
{
@@ -1019,37 +838,16 @@ public class MyfacesConfig
_prettyHtml = prettyHtml;
}
- public boolean isDetectJavascript()
- {
- return _detectJavascript;
- }
-
- private void setDetectJavascript(boolean detectJavascript)
+ public long getConfigRefreshPeriod()
{
- _detectJavascript = detectJavascript;
+ return _configRefreshPeriod;
}
- private void setReadonlyAsDisabledForSelect(boolean readonlyAsDisabledForSelect)
+ public void setConfigRefreshPeriod(long configRefreshPeriod)
{
- _readonlyAsDisabledForSelect = readonlyAsDisabledForSelect;
+ _configRefreshPeriod = configRefreshPeriod;
}
- public boolean isReadonlyAsDisabledForSelect()
- {
- return _readonlyAsDisabledForSelect;
- }
-
-
- public long getConfigRefreshPeriod()
- {
- return _configRefreshPeriod;
- }
-
- public void setConfigRefreshPeriod(long configRefreshPeriod)
- {
- _configRefreshPeriod = configRefreshPeriod;
- }
-
/**
* JSF API 1.2 defines a "javax.faces.ViewState" client parameter, that must be rendered as both the "name"
* and the "id" attribute of the hidden input that is rendered for the purpose of state saving
@@ -1097,11 +895,6 @@ public class MyfacesConfig
_strictXhtmlLinks = strictXhtmlLinks;
}
- public boolean isTomahawkAvailable()
- {
- return TOMAHAWK_AVAILABLE;
- }
-
public boolean isMyfacesImplAvailable()
{
return MYFACES_IMPL_AVAILABLE;
@@ -1113,63 +906,6 @@ public class MyfacesConfig
}
/**
- * @deprecated
- */
- public boolean isAllowJavascript()
- {
- return _allowJavascript;
- }
-
- private void setAllowJavascript(boolean allowJavascript)
- {
- _allowJavascript = allowJavascript;
- }
-
- public boolean isAutoScroll()
- {
- return _autoScroll;
- }
-
- private void setAutoScroll(boolean autoScroll)
- {
- _autoScroll = autoScroll;
- }
-
- private void setAddResourceClass(String addResourceClass)
- {
- _addResourceClass = addResourceClass;
- }
-
- public String getAddResourceClass()
- {
- return _addResourceClass;
- }
-
- /**
- * ExtensionFilter needs access to AddResourceClass init param without having
- * an ExternalContext at hand.
- */
- public static String getAddResourceClassFromServletContext(ServletContext servletContext)
- {
- String addResourceClass = servletContext.getInitParameter(INIT_PARAM_ADD_RESOURCE_CLASS);
-
- return addResourceClass == null ? INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT : addResourceClass;
- }
-
- /**
- * Should the environment be checked so that the ExtensionsFilter will work properly.
- */
- public boolean isCheckExtensionsFilter()
- {
- return _checkExtensionsFilter;
- }
-
- public void setCheckExtensionsFilter(boolean extensionsFilter)
- {
- _checkExtensionsFilter = extensionsFilter;
- }
-
- /**
*
*/
public boolean isViewStateJavascript()
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
index 14a1164..9ffd61b 100755
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
@@ -22,7 +22,6 @@ import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
-import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
@@ -58,7 +57,6 @@ import javax.faces.component.html.HtmlInputText;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;
-import javax.faces.event.PhaseId;
import javax.faces.model.SelectItem;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
@@ -75,37 +73,9 @@ public final class RendererUtils
//nope
}
- //private static final Log log = LogFactory.getLog(RendererUtils.class);
- private static final Logger log = Logger.getLogger(RendererUtils.class
- .getName());
+ private static final Logger log = Logger.getLogger(RendererUtils.class.getName());
- public static final String SELECT_ITEM_LIST_ATTR = RendererUtils.class
- .getName() + ".LIST";
public static final String EMPTY_STRING = "";
- //This constant is no longer used by UISelectOne/UISelectMany instances
- public static final Object NOTHING = new Serializable()
- {
- public boolean equals(final Object o)
- {
- if (o != null)
- {
- if (o.getClass().equals(this.getClass()))
- {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int hashCode()
- {
- return super.hashCode();
- }
- };
-
- public static final String ACTION_FOR_LIST = "org.apache.myfaces.ActionForList";
- public static final String ACTION_FOR_PHASE_LIST = "org.apache.myfaces.ActionForPhaseList";
public static final String SEQUENCE_PARAM = "jsf_sequence";
@@ -767,14 +737,6 @@ public final class RendererUtils
private static List<SelectItem> internalGetSelectItemList(UIComponent uiComponent,
FacesContext facesContext)
{
- /* TODO: Shall we cache the list in a component attribute?
- ArrayList list = (ArrayList)uiComponent.getAttributes().get(SELECT_ITEM_LIST_ATTR);
- if (list != null)
- {
- return list;
- }
- */
-
List<SelectItem> list = new ArrayList<SelectItem>();
for (SelectItemsIterator iter = new SelectItemsIterator(uiComponent, facesContext); iter.hasNext();)
@@ -1064,16 +1026,11 @@ public final class RendererUtils
return i != null ? i.intValue() : defaultValue;
}
- private static final String TRINIDAD_FORM_COMPONENT_FAMILY = "org.apache.myfaces.trinidad.Form";
- private static final String ADF_FORM_COMPONENT_FAMILY = "oracle.adf.Form";
-
/**
* Find the enclosing form of a component
* in the view-tree.
* All Subclasses of <code>UIForm</code> and all known
* form-families are searched for.
- * Currently those are the Trinidad form family,
- * and the (old) ADF Faces form family.
* <p>
* There might be additional form families
* which have to be explicitly entered here.</p>
@@ -1086,10 +1043,7 @@ public final class RendererUtils
FacesContext facesContext)
{
UIComponent parent = uiComponent.getParent();
- while (parent != null
- && (!ADF_FORM_COMPONENT_FAMILY.equals(parent.getFamily())
- && !TRINIDAD_FORM_COMPONENT_FAMILY.equals(parent
- .getFamily()) && !(parent instanceof UIForm)))
+ while (parent != null && !(parent instanceof UIForm))
{
parent = parent.getParent();
}
@@ -1269,53 +1223,6 @@ public final class RendererUtils
}
- public static List convertIdsToClientIds(String actionFor,
- FacesContext facesContext, UIComponent component)
- {
- List li = new ArrayList();
-
- String[] ids = actionFor.split(",");
-
- for (int i = 0; i < ids.length; i++)
- {
- String trimedId = ids[i].trim();
- if (trimedId.equals("none"))
- {
- li.add(trimedId);
- }
- else
- {
- li.add(RendererUtils.getClientId(facesContext, component,
- trimedId));
- }
- }
- return li;
- }
-
- public static List convertPhasesToPhasesIds(String actionForPhase)
- {
- List li = new ArrayList();
-
- if (actionForPhase == null)
- {
- return li;
- }
-
- String[] ids = actionForPhase.split(",");
-
- for (int i = 0; i < ids.length; i++)
- {
- if (ids[i].equals("PROCESS_VALIDATIONS"))
- {
- li.add(PhaseId.PROCESS_VALIDATIONS);
- }
- else if (ids[i].equals("UPDATE_MODEL_VALUES"))
- {
- li.add(PhaseId.UPDATE_MODEL_VALUES);
- }
- }
- return li;
- }
/**
* Helper method which loads a resource file (such as css) by a given context path and a file name.
@@ -1393,46 +1300,6 @@ public final class RendererUtils
}
/**
- * check for partial validation or model update attributes being set
- * and initialize the request-map accordingly.
- * SubForms will work with this information.
- */
- public static void initPartialValidationAndModelUpdate(
- UIComponent component, FacesContext facesContext)
- {
- String actionFor = (String) component.getAttributes().get("actionFor");
-
- if (actionFor != null)
- {
- List li = convertIdsToClientIds(actionFor, facesContext, component);
-
- facesContext.getExternalContext().getRequestMap()
- .put(ACTION_FOR_LIST, li);
-
- String actionForPhase = (String) component.getAttributes().get(
- "actionForPhase");
-
- if (actionForPhase != null)
- {
- List phaseList = convertPhasesToPhasesIds(actionForPhase);
-
- facesContext.getExternalContext().getRequestMap()
- .put(ACTION_FOR_PHASE_LIST, phaseList);
- }
- }
- }
-
- public static boolean isAdfOrTrinidadForm(UIComponent component)
- {
- if (component == null)
- {
- return false;
- }
- return ADF_FORM_COMPONENT_FAMILY.equals(component.getFamily())
- || TRINIDAD_FORM_COMPONENT_FAMILY.equals(component.getFamily());
- }
-
- /**
* Gets the ResponseStateManager for the renderKit Id provided
*
* @deprecated use FacesContext.getRenderKit() or getRenderKitFactory().getRenderKit(
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
index b7189bf..2f16bcf 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlButtonRendererBase.java
@@ -44,7 +44,6 @@ 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;
public class HtmlButtonRendererBase
extends HtmlRenderer
@@ -52,8 +51,6 @@ public class HtmlButtonRendererBase
private static final String IMAGE_BUTTON_SUFFIX_X = ".x";
private static final String IMAGE_BUTTON_SUFFIX_Y = ".y";
- public static final String ACTION_FOR_LIST = "org.apache.myfaces.ActionForList";
-
public void decode(FacesContext facesContext, UIComponent uiComponent)
{
org.apache.myfaces.shared.renderkit.RendererUtils.checkParamValidity(
@@ -62,13 +59,7 @@ public class HtmlButtonRendererBase
//super.decode must not be called, because value is handled here
boolean disabled = isDisabled(facesContext, uiComponent);
// MYFACES-3960 Decode, decode client behavior and queue action event at the end
- boolean activateActionEvent = !isReset(uiComponent) && isSubmitted(facesContext, uiComponent) &&
- !disabled;
- if (activateActionEvent)
- {
- org.apache.myfaces.shared.renderkit.RendererUtils.initPartialValidationAndModelUpdate(
- uiComponent, facesContext);
- }
+ boolean activateActionEvent = !isReset(uiComponent) && isSubmitted(facesContext, uiComponent) && !disabled;
if (uiComponent instanceof ClientBehaviorHolder &&
!disabled)
@@ -96,7 +87,7 @@ public class HtmlButtonRendererBase
{
String clientId = uiComponent.getClientId(facesContext);
Map paramMap = facesContext.getExternalContext().getRequestParameterMap();
- FormInfo formInfo = _ComponentUtils.findNestingForm(uiComponent, facesContext);
+ FormInfo formInfo = RendererUtils.findNestingForm(uiComponent, facesContext);
String hiddenLink = null;
if (formInfo != null)
@@ -149,9 +140,8 @@ public class HtmlButtonRendererBase
facesContext, childrenList, false, false);
if (formInfo != null
- && (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll() ||
- (validParams != null && !validParams.isEmpty() )))
- {
+ && (validParams != null && !validParams.isEmpty()))
+ {
HtmlRendererUtils.renderFormSubmitScript(facesContext);
}
@@ -358,11 +348,6 @@ public class HtmlButtonRendererBase
//call the script to clear the form (clearFormHiddenParams_<formName>) method
HtmlRendererUtils.appendClearHiddenCommandFormParamsFunctionCall(rendererOnClick, formName);
}
-
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
- {
- HtmlRendererUtils.appendAutoScrollAssignment(rendererOnClick, formName);
- }
//}
}
@@ -384,34 +369,24 @@ public class HtmlButtonRendererBase
StringBuilder onClick = new StringBuilder();
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
- {
- onClick.append("submitForm('");
- onClick.append(formInfo.getForm().getClientId(facesContext));
- onClick.append("',1,{source:'");
- onClick.append(component.getClientId(facesContext));
- onClick.append("'});return false;");
- }
- else
- {
- StringBuilder params = addChildParameters(facesContext, nestingForm, validParams);
+ StringBuilder params = addChildParameters(facesContext, nestingForm, validParams);
- String target = getTarget(component);
+ String target = getTarget(component);
- 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)
- {
- onClick.append(",").
- append(target == null ? "null" : ("'" + target + "'")).append(",").
- append(params);
- }
- onClick.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)
+ {
+ onClick.append(",").
+ append(target == null ? "null" : ("'" + target + "'")).append(",").
+ append(params);
}
+ onClick.append(");");
+
+
return onClick.toString();
}
@@ -591,11 +566,6 @@ public class HtmlButtonRendererBase
//call the script to clear the form (clearFormHiddenParams_<formName>) method
HtmlRendererUtils.appendClearHiddenCommandFormParamsFunctionCall(onClick, formName);
}
-
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
- {
- HtmlRendererUtils.appendAutoScrollAssignment(onClick, formName);
- }
}
}
@@ -628,8 +598,7 @@ public class HtmlButtonRendererBase
}
/**
- * find nesting form<p>
- * need to be overrideable to deal with dummyForm stuff in tomahawk.</p>
+ * find nesting form
*/
protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
{
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
index 6db6ab6..7f66f78 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlFormRendererBase.java
@@ -328,10 +328,6 @@ public class HtmlFormRendererBase
if (facesContext.getExternalContext().getRequestMap().get(
getScrollHiddenInputName(facesContext, form)) == null)
{
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isAutoScroll())
- {
- HtmlRendererUtils.renderAutoScrollHiddenInput(facesContext, writer);
- }
facesContext.getExternalContext().getRequestMap().put(getScrollHiddenInputName(
facesContext, form), Boolean.TRUE);
}
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java
index 2a37071..a7d1c4b 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlInputFileRendererBase.java
@@ -40,9 +40,10 @@ import javax.faces.component.behavior.ClientBehavior;
import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.component.html.HtmlForm;
import javax.faces.component.html.HtmlInputText;
+
+import org.apache.myfaces.shared.renderkit.RendererUtils;
import org.apache.myfaces.shared.renderkit.html.util.FormInfo;
import org.apache.myfaces.shared.renderkit.html.util.HttpPartWrapper;
-import org.apache.myfaces.shared.util._ComponentUtils;
public class HtmlInputFileRendererBase extends HtmlRenderer
{
@@ -91,7 +92,7 @@ public class HtmlInputFileRendererBase extends HtmlRenderer
(facesContext.getPartialViewContext().isPartialRequest() ||
facesContext.getPartialViewContext().isAjaxRequest()))
{
- FormInfo formInfo = _ComponentUtils.findNestingForm(component, facesContext);
+ FormInfo formInfo = RendererUtils.findNestingForm(component, facesContext);
if (formInfo != null && formInfo.getForm() instanceof HtmlForm)
{
HtmlForm form = (HtmlForm) formInfo.getForm();
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
index 91bcabc..1ae8bf0 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlJavaScriptUtils.java
@@ -92,29 +92,17 @@ public final class HtmlJavaScriptUtils
MyfacesConfig config = MyfacesConfig.getCurrentInstance(facesContext
.getExternalContext());
ScriptContext script = new ScriptContext();
- boolean autoScroll = config.isAutoScroll();
boolean autoSave = JavascriptUtils.isSaveFormSubmitLinkIE(facesContext
.getExternalContext());
- if (autoScroll || autoSave)
+ if (autoSave)
{
script.prettyLine();
script.increaseIndent();
script.append("(!window.myfaces) ? window.myfaces = {} : null;");
script.append("(!myfaces.core) ? myfaces.core = {} : null;");
script.append("(!myfaces.core.config) ? myfaces.core.config = {} : null;");
- }
-
- if (autoScroll)
- {
- script.append("myfaces.core.config.autoScroll = true;");
- }
- if (autoSave)
- {
script.append("myfaces.core.config.ieAutoSave = true;");
- }
- if (autoScroll || autoSave)
- {
writer.startElement(HTML.SCRIPT_ELEM, null);
writer.writeAttribute(HTML.TYPE_ATTR, "text/javascript", null);
writer.writeText(script.toString(), null);
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
index 6b9ceef..d0c4ffe 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlLinkRendererBase.java
@@ -48,18 +48,11 @@ 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.ResourceUtils;
-import org.apache.myfaces.shared.util._ComponentUtils;
public abstract class HtmlLinkRendererBase
extends HtmlRenderer
{
- /* this one is never used
- public static final String URL_STATE_MARKER = "JSF_URL_STATE_MARKER=DUMMY";
- public static final int URL_STATE_MARKER_LEN = URL_STATE_MARKER.length();
- */
- //private static final Log log = LogFactory.getLog(HtmlLinkRenderer.class);
-
public static final String END_LINK_OUTCOME_AS_SPAN =
"oam.shared.HtmlLinkRendererBase.END_LINK_OUTCOME_AS_SPAN";
@@ -87,13 +80,8 @@ public abstract class HtmlLinkRendererBase
HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo, facesContext));
activateActionEvent = reqValue != null && reqValue.equals(clientId)
|| HtmlRendererUtils.isPartialOrBehaviorSubmit(facesContext, clientId);
- if (activateActionEvent)
- {
- RendererUtils.initPartialValidationAndModelUpdate(component, facesContext);
- }
}
- if (component instanceof ClientBehaviorHolder &&
- !disabled)
+ if (component instanceof ClientBehaviorHolder && !disabled)
{
HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
}
@@ -471,46 +459,37 @@ public abstract class HtmlLinkRendererBase
onClick.append("var oamSF = function(){");
}
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
- {
- onClick.append("submitForm('");
- onClick.append(formInfo.getForm().getClientId(facesContext));
- onClick.append("',1,{source:'");
- onClick.append(component.getClientId(facesContext));
- onClick.append("'});return false;");
- }
- else
- {
- HtmlRendererUtils.renderFormSubmitScript(facesContext);
- StringBuilder params = addChildParameters(facesContext, component, nestingForm);
+ HtmlRendererUtils.renderFormSubmitScript(facesContext);
- String target = getTarget(component);
+ StringBuilder params = addChildParameters(facesContext, component, nestingForm);
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
- append(formName).append("','").
- append(clientId).append("'");
+ String target = getTarget(component);
- if (params.length() > 2 || target != null)
- {
- onClick.append(",").
- append(target == null ? "null" : ("'" + target + "'")).append(",").
- append(params);
- }
- onClick.append(");");
+ onClick.append("return ").
+ append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
+ append(formName).append("','").
+ append(clientId).append("'");
- //Not necessary since we are using oamSetHiddenInput to create input hidden fields
- //render hidden field - todo: in here for backwards compatibility
- if (MyfacesConfig.getCurrentInstance(
- facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams())
- {
- String hiddenFieldName = HtmlRendererUtils.getHiddenCommandLinkFieldName(
- formInfo, facesContext);
- addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
- }
+ if (params.length() > 2 || target != null)
+ {
+ onClick.append(",").
+ append(target == null ? "null" : ("'" + target + "'")).append(",").
+ append(params);
+ }
+ onClick.append(");");
+ //Not necessary since we are using oamSetHiddenInput to create input hidden fields
+ //render hidden field - todo: in here for backwards compatibility
+ if (MyfacesConfig.getCurrentInstance(
+ facesContext.getExternalContext()).isRenderHiddenFieldsForLinkParams())
+ {
+ String hiddenFieldName = HtmlRendererUtils.getHiddenCommandLinkFieldName(
+ formInfo, facesContext);
+ addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
}
+
+
if (commandOnclick != null)
{
@@ -621,41 +600,25 @@ public abstract class HtmlLinkRendererBase
StringBuilder onClick = new StringBuilder();
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
- {
- onClick.append("submitForm('");
- onClick.append(formInfo.getForm().getClientId(facesContext));
- onClick.append("',1,{source:'");
- onClick.append(component.getClientId(facesContext));
- onClick.append("'});return false;");
- }
- else
- {
- HtmlRendererUtils.renderFormSubmitScript(facesContext);
+ HtmlRendererUtils.renderFormSubmitScript(facesContext);
- StringBuilder params = addChildParameters(facesContext, component, nestingForm);
+ StringBuilder params = addChildParameters(facesContext, component, nestingForm);
- String target = getTarget(component);
+ String target = getTarget(component);
- onClick.append("return ").
- append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
- append(formName).append("','").
- append(clientId).append("'");
-
- if (params.length() > 2 || target != null)
- {
- onClick.append(",").
- append(target == null ? "null" : ("'" + target + "'")).append(",").
- append(params);
- }
- onClick.append(");");
-
- //Not necessary since we are using oamSetHiddenInput to create input hidden fields
- //render hidden field - todo: in here for backwards compatibility
- //String hiddenFieldName = HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo);
- //addHiddenCommandParameter(facesContext, nestingForm, hiddenFieldName);
+ onClick.append("return ").
+ append(HtmlRendererUtils.SUBMIT_FORM_FN_NAME_JSF2).append("('").
+ append(formName).append("','").
+ append(clientId).append("'");
+ if (params.length() > 2 || target != null)
+ {
+ onClick.append(",").
+ append(target == null ? "null" : ("'" + target + "'")).append(",").
+ append(params);
}
+ onClick.append(");");
+
return onClick.toString();
}
@@ -760,11 +723,10 @@ public abstract class HtmlLinkRendererBase
/**
* find nesting form<p>
- * need to be overrideable to deal with dummyForm stuff in tomahawk.</p>
*/
protected FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
{
- return _ComponentUtils.findNestingForm(uiComponent, facesContext);
+ return RendererUtils.findNestingForm(uiComponent, facesContext);
}
protected void addHiddenCommandParameter(
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
index 24c2d0a..834e76c 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
@@ -84,7 +84,6 @@ public final class HtmlRendererUtils
private static final char TABULATOR = '\t';
public static final String HIDDEN_COMMANDLINK_FIELD_NAME = "_idcl";
public static final String HIDDEN_COMMANDLINK_FIELD_NAME_MYFACES_OLD = "_link_hidden_";
- public static final String HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD = "source";
public static final String CLEAR_HIDDEN_FIELD_FN_NAME = "clearFormHiddenParams";
public static final String SUBMIT_FORM_FN_NAME = "oamSubmitForm";
public static final String SUBMIT_FORM_FN_NAME_JSF2 = "myfaces.oam.submitForm";
@@ -730,9 +729,8 @@ public final class HtmlRendererUtils
{
escape = ((EscapeCapable) component).isEscape();
- // Preserve tomahawk semantic. If escape=false
- // all items should be non escaped. If escape
- // is true check if selectItem.isEscape() is
+ // If escape=false all items should be non escaped.
+ // If escape is true check if selectItem.isEscape() is
// true and do it.
// This is done for remain compatibility.
if (escape && selectItem.isEscape())
@@ -1663,10 +1661,6 @@ public final class HtmlRendererUtils
*/
public static String getHiddenCommandLinkFieldName(FormInfo formInfo)
{
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
- {
- return HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD;
- }
return formInfo.getFormName() + ':'
+ HIDDEN_COMMANDLINK_FIELD_NAME;
}
@@ -1674,10 +1668,6 @@ public final class HtmlRendererUtils
public static String getHiddenCommandLinkFieldName(
FormInfo formInfo, FacesContext facesContext)
{
- if (RendererUtils.isAdfOrTrinidadForm(formInfo.getForm()))
- {
- return HIDDEN_COMMANDLINK_FIELD_NAME_TRINIDAD;
- }
return formInfo.getFormName() + ':'
+ HIDDEN_COMMANDLINK_FIELD_NAME;
}
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
index e60eabd..88082dc 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.java
@@ -490,7 +490,6 @@ public class HtmlResponseWriterImpl
private boolean isEmptyElement(String elem)
{
- // Code taken from trinidad
// =-=AEW Performance? Certainly slower to use a hashtable,
// at least if we can't assume the input name is lowercased.
// -= Leonardo Uribe =- elem.toLowerCase() internally creates an array,
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
index 1c60033..641c6ce 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/ResourceUtils.java
@@ -23,12 +23,9 @@ import javax.faces.FacesWrapper;
import javax.faces.application.Resource;
import javax.faces.application.ResourceHandler;
-import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-import org.apache.myfaces.shared.config.MyfacesConfig;
-import org.apache.myfaces.shared.renderkit.JSFAttr;
import org.apache.myfaces.shared.renderkit.html.HTML;
import org.apache.myfaces.shared.resource.ContractResource;
@@ -37,11 +34,6 @@ import org.apache.myfaces.shared.resource.ContractResource;
*/
public class ResourceUtils
{
- @Deprecated //Use the one from JSF 2.3 ResourceHandler
- public final static String JAVAX_FACES_LIBRARY_NAME = "javax.faces";
- @Deprecated //Use the one from JSF 2.3 ResourceHandler
- public final static String JSF_JS_RESOURCE_NAME = "jsf.js";
-
public final static String MYFACES_JS_RESOURCE_NAME = "oamSubmit.js";
public final static String MYFACES_JS_RESOURCE_NAME_UNCOMPRESSED = "oamSubmit-uncompressed.js";
public final static String MYFACES_LIBRARY_NAME = "org.apache.myfaces";
@@ -60,9 +52,6 @@ public class ResourceUtils
public final static String JSF_MYFACES_JSFJS_LEGACY = "jsf-legacy.js";
private final static String RENDERED_JSF_JS = "org.apache.myfaces.RENDERED_JSF_JS";
- public final static String HEAD_TARGET = "head";
- public final static String BODY_TARGET = "body";
- public final static String FORM_TARGET = "form";
public static final String JAVAX_FACES_OUTPUT_COMPONENT_TYPE = "javax.faces.Output";
public static final String JAVAX_FACES_TEXT_RENDERER_TYPE = "javax.faces.Text";
@@ -98,26 +87,14 @@ public class ResourceUtils
{
if (!ResourceUtils.isRenderedScript(facesContext, libraryName, resourceName))
{
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRiImplAvailable())
- {
- //Use more compatible way.
- UIComponent outputScript = facesContext.getApplication().
- createComponent(facesContext, JAVAX_FACES_OUTPUT_COMPONENT_TYPE, DEFAULT_SCRIPT_RENDERER_TYPE);
- outputScript.getAttributes().put(JSFAttr.NAME_ATTR, resourceName);
- outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, libraryName);
- outputScript.encodeAll(facesContext);
- }
- else
- {
- //Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
- Resource resource = facesContext.getApplication().getResourceHandler().createResource(
- resourceName, libraryName);
- markScriptAsRendered(facesContext, libraryName, resourceName);
- writer.startElement(HTML.SCRIPT_ELEM, null);
- writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT , null);
- writer.writeURIAttribute(HTML.SRC_ATTR, resource.getRequestPath(), null);
- writer.endElement(HTML.SCRIPT_ELEM);
- }
+ //Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
+ Resource resource = facesContext.getApplication().getResourceHandler().createResource(
+ resourceName, libraryName);
+ markScriptAsRendered(facesContext, libraryName, resourceName);
+ writer.startElement(HTML.SCRIPT_ELEM, null);
+ writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT , null);
+ writer.writeURIAttribute(HTML.SRC_ATTR, resource.getRequestPath(), null);
+ writer.endElement(HTML.SCRIPT_ELEM);
}
}
@@ -147,42 +124,16 @@ public class ResourceUtils
{
return;
}
-
- // Here we have two cases:
- // 1. The standard script could be put in another target (body or form).
- // 2. RI is used so it is not used our set to check for rendered resources
- // and we don't have access to that one.
- //
- // Check if we have the resource registered on UIViewRoot "body" or "form" target
- // is not safe, because the page could not use h:body or h:form.
- // Anyway, there is no clear reason why page authors could do the first one,
- // but the second one could be.
- //
- // Finally we need to force render the script. If the script has been already rendered
- // (RI used and rendered as a h:outputScript not relocated), nothing will happen because the default
- // script renderer will check if the script has been rendered first.
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRiImplAvailable())
- {
- //Use more compatible way.
- UIComponent outputScript = facesContext.getApplication().
- createComponent(facesContext, JAVAX_FACES_OUTPUT_COMPONENT_TYPE, DEFAULT_SCRIPT_RENDERER_TYPE);
- outputScript.getAttributes().put(JSFAttr.NAME_ATTR, ResourceHandler.JSF_SCRIPT_RESOURCE_NAME);
- outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
- outputScript.encodeAll(facesContext);
- }
- else
- {
- //Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
- Resource resource = facesContext.getApplication().getResourceHandler().createResource(
- ResourceHandler.JSF_SCRIPT_RESOURCE_NAME, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
- markScriptAsRendered(facesContext, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME,
- ResourceHandler.JSF_SCRIPT_RESOURCE_NAME);
- writer.startElement(HTML.SCRIPT_ELEM, null);
- writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
- writer.writeURIAttribute(HTML.SRC_ATTR, resource.getRequestPath(), null);
- writer.endElement(HTML.SCRIPT_ELEM);
- }
+ //Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
+ Resource resource = facesContext.getApplication().getResourceHandler().createResource(
+ ResourceHandler.JSF_SCRIPT_RESOURCE_NAME, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME);
+ markScriptAsRendered(facesContext, ResourceHandler.JSF_SCRIPT_LIBRARY_NAME,
+ ResourceHandler.JSF_SCRIPT_RESOURCE_NAME);
+ writer.startElement(HTML.SCRIPT_ELEM, null);
+ writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
+ writer.writeURIAttribute(HTML.SRC_ATTR, resource.getRequestPath(), null);
+ writer.endElement(HTML.SCRIPT_ELEM);
//mark as rendered
facesContext.getAttributes().put(RENDERED_JSF_JS, Boolean.TRUE);
@@ -216,39 +167,14 @@ public class ResourceUtils
return;
}
- // Here we have two cases:
- // 1. The standard script could be put in another target (body or form).
- // 2. RI is used so it is not used our set to check for rendered resources
- // and we don't have access to that one.
- //
- // Check if we have the resource registered on UIViewRoot "body" or "form" target
- // is not safe, because the page could not use h:body or h:form.
- // Anyway, there is no clear reason why page authors could do the first one,
- // but the second one could be.
- //
- // Finally we need to force render the script. If the script has been already rendered
- // (RI used and rendered as a h:outputScript not relocated), nothing will happen because the default
- // script renderer will check if the script has been rendered first.
- if (MyfacesConfig.getCurrentInstance(facesContext.getExternalContext()).isRiImplAvailable())
- {
- //Use more compatible way.
- UIComponent outputScript = facesContext.getApplication().
- createComponent(facesContext, JAVAX_FACES_OUTPUT_COMPONENT_TYPE, DEFAULT_SCRIPT_RENDERER_TYPE);
- outputScript.getAttributes().put(JSFAttr.NAME_ATTR, MYFACES_JS_RESOURCE_NAME);
- outputScript.getAttributes().put(JSFAttr.LIBRARY_ATTR, MYFACES_LIBRARY_NAME);
- outputScript.encodeAll(facesContext);
- }
- else
- {
- //Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
- Resource resource = facesContext.getApplication().getResourceHandler().createResource(
- MYFACES_JS_RESOURCE_NAME, MYFACES_LIBRARY_NAME);
- markScriptAsRendered(facesContext, MYFACES_LIBRARY_NAME, MYFACES_JS_RESOURCE_NAME);
- writer.startElement(HTML.SCRIPT_ELEM, null);
- writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
- writer.writeURIAttribute(HTML.SRC_ATTR, resource.getRequestPath(), null);
- writer.endElement(HTML.SCRIPT_ELEM);
- }
+ //Fast shortcut, don't create component instance and do what HtmlScriptRenderer do.
+ Resource resource = facesContext.getApplication().getResourceHandler().createResource(
+ MYFACES_JS_RESOURCE_NAME, MYFACES_LIBRARY_NAME);
+ markScriptAsRendered(facesContext, MYFACES_LIBRARY_NAME, MYFACES_JS_RESOURCE_NAME);
+ writer.startElement(HTML.SCRIPT_ELEM, null);
+ writer.writeAttribute(HTML.SCRIPT_TYPE_ATTR, HTML.SCRIPT_TYPE_TEXT_JAVASCRIPT, null);
+ writer.writeURIAttribute(HTML.SRC_ATTR, resource.getRequestPath(), null);
+ writer.endElement(HTML.SCRIPT_ELEM);
//mark as rendered
facesContext.getAttributes().put(RENDERED_MYFACES_JS, Boolean.TRUE);
diff --git a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java
index 9868360..6e0d3dd 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/renderkit/html/util/SelectItemsUtils.java
@@ -178,9 +178,8 @@ public class SelectItemsUtils
{
escape = ((EscapeCapable) component).isEscape();
- // Preserve tomahawk semantic. If escape=false
- // all items should be non escaped. If escape
- // is true check if selectItem.isEscape() is
+ // If escape=false all items should be non escaped.
+ // If escape is true check if selectItem.isEscape() is
// true and do it.
// This is done for remain compatibility.
if (escape && selectItem.isEscape())
diff --git a/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java b/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java
index bfdc6d3..452fbbd 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/resource/ResourceLoaderUtils.java
@@ -75,8 +75,7 @@ public class ResourceLoaderUtils
}
return Long.valueOf(date.getTime());
}
-
- //Taken from trinidad URLUtils
+
public static long getResourceLastModified(URL url) throws IOException
{
if ("file".equals(url.getProtocol()))
@@ -93,7 +92,6 @@ public class ResourceLoaderUtils
}
}
- //Taken from trinidad URLUtils
public static long getResourceLastModified(URLConnection connection) throws IOException
{
long modified;
diff --git a/shared/src/main/java/org/apache/myfaces/shared/util/SubKeyMap.java b/shared/src/main/java/org/apache/myfaces/shared/util/SubKeyMap.java
index 7ae30cd..da7582f 100644
--- a/shared/src/main/java/org/apache/myfaces/shared/util/SubKeyMap.java
+++ b/shared/src/main/java/org/apache/myfaces/shared/util/SubKeyMap.java
@@ -27,8 +27,6 @@ import java.util.Map;
import java.util.Set;
/**
- * NOTE: Class copied from trinidad to be used on FlashImpl.
- *
* Map that wraps another to provide an isolated namespace using
* a prefix. This is especially handy for storing properties on
* the session in a structured manner without putting them into
diff --git a/shared/src/main/java/org/apache/myfaces/shared/util/_ComponentUtils.java b/shared/src/main/java/org/apache/myfaces/shared/util/_ComponentUtils.java
deleted file mode 100644
index 4a29780..0000000
--- a/shared/src/main/java/org/apache/myfaces/shared/util/_ComponentUtils.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.myfaces.shared.util;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.apache.myfaces.shared.renderkit.RendererUtils;
-import org.apache.myfaces.shared.renderkit.html.util.FormInfo;
-
-public final class _ComponentUtils
-{
-
- private _ComponentUtils()
- {
- }
-
- public static FormInfo findNestingForm(UIComponent uiComponent, FacesContext facesContext)
- {
- return RendererUtils.findNestingForm(uiComponent, facesContext);
- }
-}