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 2020/10/30 17:41:12 UTC
[myfaces] branch master updated: Jakarta Faces 4.0 - Removed JSP
support; Part1 Tag Files
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
The following commit(s) were added to refs/heads/master by this push:
new 7d2d9ac Jakarta Faces 4.0 - Removed JSP support; Part1 Tag Files
7d2d9ac is described below
commit 7d2d9ac1ea2930c531679c1d109c499b97deb65a
Author: Thomas Andraschko <ta...@apache.org>
AuthorDate: Fri Oct 30 18:41:05 2020 +0100
Jakarta Faces 4.0 - Removed JSP support; Part1 Tag Files
---
api/pom.xml | 1 -
.../jakarta/faces/component/UINamingContainer.java | 7 +-
.../jakarta/faces/component/UIViewParameter.java | 3 +-
.../java/jakarta/faces/component/UIViewRoot.java | 2 +-
.../java/jakarta/faces/component/_UIParameter.java | 3 +-
.../jakarta/faces/component/_UISelectItem.java | 4 +-
.../jakarta/faces/component/_UISelectItems.java | 1 -
.../jakarta/faces/convert/DateTimeConverter.java | 5 +-
.../jakarta/faces/convert/NumberConverter.java | 5 +-
.../faces/validator/DoubleRangeValidator.java | 5 +-
.../jakarta/faces/validator/LengthValidator.java | 5 +-
.../faces/validator/LongRangeValidator.java | 5 +-
.../jakarta/faces/validator/RegexValidator.java | 5 +-
.../java/jakarta/faces/webapp/AttributeTag.java | 115 --
.../java/jakarta/faces/webapp/ConverterELTag.java | 66 -
.../java/jakarta/faces/webapp/ConverterTag.java | 110 --
.../main/java/jakarta/faces/webapp/FacetTag.java | 67 -
.../jakarta/faces/webapp/UIComponentBodyTag.java | 29 -
.../faces/webapp/UIComponentClassicTagBase.java | 1348 --------------------
.../jakarta/faces/webapp/UIComponentELTag.java | 134 --
.../java/jakarta/faces/webapp/UIComponentTag.java | 339 -----
.../jakarta/faces/webapp/UIComponentTagBase.java | 108 --
.../java/jakarta/faces/webapp/ValidatorELTag.java | 63 -
.../java/jakarta/faces/webapp/ValidatorTag.java | 110 --
impl/pom.xml | 15 -
.../myfaces/taglib/core/ActionListenerTag.java | 80 --
.../apache/myfaces/taglib/core/AttributeTag.java | 146 ---
.../myfaces/taglib/core/ConvertDateTimeTag.java | 303 -----
.../myfaces/taglib/core/ConvertNumberTag.java | 203 ---
.../myfaces/taglib/core/ConverterImplTag.java | 161 ---
.../apache/myfaces/taglib/core/ConverterTag.java | 139 --
.../taglib/core/DelegateActionListener.java | 165 ---
.../myfaces/taglib/core/DelegateConverter.java | 176 ---
.../myfaces/taglib/core/DelegateValidator.java | 165 ---
.../taglib/core/DelegateValueChangeListener.java | 166 ---
.../myfaces/taglib/core/GenericListenerTag.java | 186 ---
.../taglib/core/GenericMinMaxValidatorTag.java | 104 --
.../apache/myfaces/taglib/core/LoadBundleTag.java | 304 -----
.../org/apache/myfaces/taglib/core/ParamTag.java | 63 -
.../myfaces/taglib/core/PhaseListenerTag.java | 233 ----
.../apache/myfaces/taglib/core/SelectItemTag.java | 98 --
.../taglib/core/SetPropertyActionListenerTag.java | 140 --
.../org/apache/myfaces/taglib/core/SubviewTag.java | 96 --
.../myfaces/taglib/core/UIComponentELTagBase.java | 215 ----
.../myfaces/taglib/core/UIComponentELTagUtils.java | 410 ------
.../taglib/core/ValidateDoubleRangeTag.java | 65 -
.../myfaces/taglib/core/ValidateLengthTag.java | 65 -
.../myfaces/taglib/core/ValidateLongRangeTag.java | 65 -
.../myfaces/taglib/core/ValidateRegexTag.java | 111 --
.../myfaces/taglib/core/ValidateRequiredTag.java | 97 --
.../myfaces/taglib/core/ValidatorImplTag.java | 167 ---
.../apache/myfaces/taglib/core/ValidatorTag.java | 123 --
.../taglib/core/ValueChangeListenerTag.java | 88 --
.../apache/myfaces/taglib/core/VerbatimTag.java | 102 --
.../org/apache/myfaces/taglib/core/ViewTag.java | 261 ----
.../tag/jsf/core/ActionListenerHandler.java | 5 +-
.../facelets/tag/jsf/core/AttributeHandler.java | 5 +-
.../tag/jsf/core/ConvertDelegateHandler.java | 5 +-
.../facelets/tag/jsf/core/LoadBundleHandler.java | 5 +-
.../tag/jsf/core/PhaseListenerHandler.java | 5 +-
.../jsf/core/SetPropertyActionListenerHandler.java | 5 +-
.../tag/jsf/core/ValidateDelegateHandler.java | 5 +-
.../tag/jsf/core/ValueChangeListenerHandler.java | 5 +-
.../facelets/tag/jsf/core/VerbatimHandler.java | 5 +-
impl/src/main/resources/META-INF/tagClass12.vm | 192 ---
65 files changed, 22 insertions(+), 7467 deletions(-)
diff --git a/api/pom.xml b/api/pom.xml
index 534ea67..963e5e6 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -373,7 +373,6 @@
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<excludes>
- <exclude>**/*Tag.class</exclude>
</excludes>
</fileSet>
</fileSets>
diff --git a/api/src/main/java/jakarta/faces/component/UINamingContainer.java b/api/src/main/java/jakarta/faces/component/UINamingContainer.java
index 996e8c4..322f594 100644
--- a/api/src/main/java/jakarta/faces/component/UINamingContainer.java
+++ b/api/src/main/java/jakarta/faces/component/UINamingContainer.java
@@ -38,11 +38,8 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFPropert
* See the javadocs for interface NamingContainer for further details.
* </p>
*/
-@JSFComponent(
- name="f:subview",
- bodyContent="JSP",
- tagClass="org.apache.myfaces.taglib.core.SubviewTag")
-@JSFJspProperty(name="id",required=true)
+@JSFComponent(name="f:subview")
+@JSFJspProperty(name="id", required=true)
public class UINamingContainer extends UIComponentBase implements NamingContainer, UniqueIdVendor
{
public static final String COMPONENT_TYPE = "jakarta.faces.NamingContainer";
diff --git a/api/src/main/java/jakarta/faces/component/UIViewParameter.java b/api/src/main/java/jakarta/faces/component/UIViewParameter.java
index e06790f..03db5d5 100644
--- a/api/src/main/java/jakarta/faces/component/UIViewParameter.java
+++ b/api/src/main/java/jakarta/faces/component/UIViewParameter.java
@@ -48,8 +48,7 @@ import org.apache.myfaces.core.api.shared.MessageUtils;
*
* @since 2.0
*/
-@JSFComponent(name = "f:viewParam", bodyContent = "JSP",
- tagClass = "org.apache.myfaces.taglib.core.ViewParamTag")
+@JSFComponent(name = "f:viewParam")
@JSFJspProperty(name = "maxlength", returnType = "int",
longDesc = "The max number or characters allowed for this param")
public class UIViewParameter extends UIInput
diff --git a/api/src/main/java/jakarta/faces/component/UIViewRoot.java b/api/src/main/java/jakarta/faces/component/UIViewRoot.java
index e82574b..ad5c383 100644
--- a/api/src/main/java/jakarta/faces/component/UIViewRoot.java
+++ b/api/src/main/java/jakarta/faces/component/UIViewRoot.java
@@ -78,7 +78,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConf
* Specification</a> for further details.
* </p>
*/
-@JSFComponent(name = "f:view", bodyContent = "JSP", tagClass = "org.apache.myfaces.taglib.core.ViewTag")
+@JSFComponent(name = "f:view")
@JSFJspProperty(name = "binding", returnType = "java.lang.String", tagExcluded = true)
public class UIViewRoot extends UIComponentBase implements UniqueIdVendor
{
diff --git a/api/src/main/java/jakarta/faces/component/_UIParameter.java b/api/src/main/java/jakarta/faces/component/_UIParameter.java
index 2e1fca8..449a084 100644
--- a/api/src/main/java/jakarta/faces/component/_UIParameter.java
+++ b/api/src/main/java/jakarta/faces/component/_UIParameter.java
@@ -30,8 +30,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFPropert
* Unless otherwise specified, all attributes accept static values or EL expressions.
* </p>
*/
-@JSFComponent(clazz = "jakarta.faces.component.UIParameter", template = true,
- name = "f:param", tagClass = "org.apache.myfaces.taglib.core.ParamTag")
+@JSFComponent(clazz = "jakarta.faces.component.UIParameter", template = true, name = "f:param")
abstract class _UIParameter extends UIComponentBase
{
diff --git a/api/src/main/java/jakarta/faces/component/_UISelectItem.java b/api/src/main/java/jakarta/faces/component/_UISelectItem.java
index 1729546..ed4a3b7 100644
--- a/api/src/main/java/jakarta/faces/component/_UISelectItem.java
+++ b/api/src/main/java/jakarta/faces/component/_UISelectItem.java
@@ -34,8 +34,8 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFPropert
* SelectItem instance to the list of available options for the parent component
* </p>
*/
-@JSFComponent(clazz = "jakarta.faces.component.UISelectItem", template = true, name = "f:selectItem",
- tagClass = "org.apache.myfaces.taglib.core.SelectItemTag", bodyContent = "empty")
+@JSFComponent(clazz = "jakarta.faces.component.UISelectItem", template = true, name = "f:selectItem",
+ bodyContent = "empty")
abstract class _UISelectItem extends UIComponentBase
{
diff --git a/api/src/main/java/jakarta/faces/component/_UISelectItems.java b/api/src/main/java/jakarta/faces/component/_UISelectItems.java
index 8a45db3..64faddb 100644
--- a/api/src/main/java/jakarta/faces/component/_UISelectItems.java
+++ b/api/src/main/java/jakarta/faces/component/_UISelectItems.java
@@ -40,7 +40,6 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFPropert
@JSFComponent(clazz = "jakarta.faces.component.UISelectItems",
template = true,
name = "f:selectItems",
- tagClass = "org.apache.myfaces.taglib.core.SelectItemsTag",
bodyContent = "empty")
abstract class _UISelectItems extends UIComponentBase
{
diff --git a/api/src/main/java/jakarta/faces/convert/DateTimeConverter.java b/api/src/main/java/jakarta/faces/convert/DateTimeConverter.java
index b389151..6a7912f 100755
--- a/api/src/main/java/jakarta/faces/convert/DateTimeConverter.java
+++ b/api/src/main/java/jakarta/faces/convert/DateTimeConverter.java
@@ -51,10 +51,7 @@ import org.apache.myfaces.core.api.shared.MessageUtils;
*
* see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*/
-@JSFConverter(
- name="f:convertDateTime",
- bodyContent="empty",
- tagClass="org.apache.myfaces.taglib.core.ConvertDateTimeTag")
+@JSFConverter(name = "f:convertDateTime", bodyContent = "empty")
@JSFJspProperty(
name="binding",
returnType = "jakarta.faces.convert.DateTimeConverter",
diff --git a/api/src/main/java/jakarta/faces/convert/NumberConverter.java b/api/src/main/java/jakarta/faces/convert/NumberConverter.java
index 1589833..f70caaf 100755
--- a/api/src/main/java/jakarta/faces/convert/NumberConverter.java
+++ b/api/src/main/java/jakarta/faces/convert/NumberConverter.java
@@ -47,10 +47,7 @@ import org.apache.myfaces.core.api.shared.MessageUtils;
*
* see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*/
-@JSFConverter(
- name="f:convertNumber",
- bodyContent="empty",
- tagClass="org.apache.myfaces.taglib.core.ConvertNumberTag")
+@JSFConverter(name = "f:convertNumber", bodyContent = "empty")
@JSFJspProperty(
name="binding",
returnType = "jakarta.faces.convert.NumberConverter",
diff --git a/api/src/main/java/jakarta/faces/validator/DoubleRangeValidator.java b/api/src/main/java/jakarta/faces/validator/DoubleRangeValidator.java
index fb5730e..b8e6544 100755
--- a/api/src/main/java/jakarta/faces/validator/DoubleRangeValidator.java
+++ b/api/src/main/java/jakarta/faces/validator/DoubleRangeValidator.java
@@ -38,10 +38,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFValidat
*
* see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*/
-@JSFValidator(
- name="f:validateDoubleRange",
- bodyContent="empty",
- tagClass="org.apache.myfaces.taglib.core.ValidateDoubleRangeTag")
+@JSFValidator(name = "f:validateDoubleRange", bodyContent = "empty")
@JSFJspProperty(
name="binding",
returnType = "jakarta.faces.validator.DoubleRangeValidator",
diff --git a/api/src/main/java/jakarta/faces/validator/LengthValidator.java b/api/src/main/java/jakarta/faces/validator/LengthValidator.java
index f166535..5dc0189 100755
--- a/api/src/main/java/jakarta/faces/validator/LengthValidator.java
+++ b/api/src/main/java/jakarta/faces/validator/LengthValidator.java
@@ -39,10 +39,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFValidat
*
* see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*/
-@JSFValidator(
- name="f:validateLength",
- bodyContent="empty",
- tagClass="org.apache.myfaces.taglib.core.ValidateLengthTag")
+@JSFValidator(name = "f:validateLength", bodyContent = "empty")
@JSFJspProperty(
name="binding",
returnType = "jakarta.faces.validator.LengthValidator",
diff --git a/api/src/main/java/jakarta/faces/validator/LongRangeValidator.java b/api/src/main/java/jakarta/faces/validator/LongRangeValidator.java
index 1fe940c..48d38eb 100755
--- a/api/src/main/java/jakarta/faces/validator/LongRangeValidator.java
+++ b/api/src/main/java/jakarta/faces/validator/LongRangeValidator.java
@@ -38,10 +38,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFValidat
*
* see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
*/
-@JSFValidator(
- name="f:validateLongRange",
- bodyContent="empty",
- tagClass="org.apache.myfaces.taglib.core.ValidateLongRangeTag")
+@JSFValidator(name = "f:validateLongRange", bodyContent = "empty")
@JSFJspProperty(
name="binding",
returnType = "jakarta.faces.validator.LongRangeValidator",
diff --git a/api/src/main/java/jakarta/faces/validator/RegexValidator.java b/api/src/main/java/jakarta/faces/validator/RegexValidator.java
index e9214d5..97dceee 100644
--- a/api/src/main/java/jakarta/faces/validator/RegexValidator.java
+++ b/api/src/main/java/jakarta/faces/validator/RegexValidator.java
@@ -70,10 +70,7 @@ import java.util.regex.PatternSyntaxException;
*
* @since 2.0
*/
-@JSFValidator(
- name="f:validateRegex",
- bodyContent="empty",
- tagClass="org.apache.myfaces.taglib.core.ValidateRegexTag")
+@JSFValidator(name = "f:validateRegex", bodyContent = "empty")
@JSFJspProperty(
name="binding",
returnType = "jakarta.faces.validator.RegexValidator",
diff --git a/api/src/main/java/jakarta/faces/webapp/AttributeTag.java b/api/src/main/java/jakarta/faces/webapp/AttributeTag.java
deleted file mode 100755
index 9d01adc..0000000
--- a/api/src/main/java/jakarta/faces/webapp/AttributeTag.java
+++ /dev/null
@@ -1,115 +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 jakarta.faces.webapp;
-
-import jakarta.faces.component.UIComponent;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-/**
- * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
- *
- * @deprecated the implementation of this clazz is now an implementation detail.
- */
-public class AttributeTag extends TagSupport
-{
- private static final long serialVersionUID = 3147657100171678632L;
- private String _name;
- private String _value;
-
- /**
- * @deprecated
- * @param name
- */
- public void setName(String name)
- {
- _name = name;
- }
-
- /**
- * @deprecated
- * @param value
- */
- public void setValue(String value)
- {
- _value = value;
- }
-
- /**
- * @deprecated
- */
- @Override
- public int doStartTag() throws JspException
- {
- UIComponentTag componentTag = UIComponentTag.getParentUIComponentTag(pageContext);
- if (componentTag == null)
- {
- throw new JspException("no parent UIComponentTag found");
- }
- UIComponent component = componentTag.getComponentInstance();
- if (component == null)
- {
- throw new JspException("parent UIComponentTag has no UIComponent");
- }
- String name = getName();
- if (component.getAttributes().get(name) == null)
- {
- Object value = getValue();
-
- if (value != null)
- {
- component.getAttributes().put(name, value);
- }
- }
- return Tag.SKIP_BODY;
- }
-
- /**
- * @deprecated
- */
- @Override
- public int doEndTag() throws JspException
- {
- this.release();
- return Tag.EVAL_PAGE;
- }
-
- /**
- * @deprecated
- */
- @Override
- public void release()
- {
- super.release();
- _name = null;
- _value = null;
- }
-
- private String getName()
- {
- return _name;
- }
-
- private Object getValue()
- {
- return _value;
- }
-
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/ConverterELTag.java b/api/src/main/java/jakarta/faces/webapp/ConverterELTag.java
deleted file mode 100644
index 828377f..0000000
--- a/api/src/main/java/jakarta/faces/webapp/ConverterELTag.java
+++ /dev/null
@@ -1,66 +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 jakarta.faces.webapp;
-
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.component.ValueHolder;
-import jakarta.faces.convert.Converter;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-/**
- * @since 1.2
- */
-public abstract class ConverterELTag extends TagSupport
-{
- private static final long serialVersionUID = -616834506829108081L;
-
- @Override
- public int doStartTag() throws JspException
- {
- UIComponentClassicTagBase componentTag = UIComponentELTag.getParentUIComponentClassicTagBase(pageContext);
- if (componentTag == null)
- {
- throw new JspException("no parent UIComponentTag found");
- }
- if (!componentTag.getCreated())
- {
- return Tag.SKIP_BODY;
- }
-
- UIComponent component = componentTag.getComponentInstance();
- if (component == null)
- {
- throw new JspException("parent UIComponentTag has no UIComponent");
- }
- if (!(component instanceof ValueHolder))
- {
- throw new JspException("UIComponent is no ValueHolder");
- }
-
- Converter converter = createConverter();
-
- ((ValueHolder)component).setConverter(converter);
-
- return Tag.SKIP_BODY;
- }
-
- protected abstract Converter createConverter() throws JspException;
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/ConverterTag.java b/api/src/main/java/jakarta/faces/webapp/ConverterTag.java
deleted file mode 100755
index b0a2c9c..0000000
--- a/api/src/main/java/jakarta/faces/webapp/ConverterTag.java
+++ /dev/null
@@ -1,110 +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 jakarta.faces.webapp;
-
-import jakarta.faces.application.Application;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.component.ValueHolder;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.convert.Converter;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-/**
- * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
- *
- * @deprecated replaced by {@link ConverterELTag}
- */
-public class ConverterTag extends TagSupport
-{
- private static final long serialVersionUID = -6168345066829108081L;
- private String _converterId;
- private String _binding;
-
- public ConverterTag()
- {
- super();
- }
-
- public void setConverterId(String converterId)
- {
- _converterId = converterId;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
-
- UIComponentClassicTagBase componentTag =
- UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext);
-
- if (componentTag == null)
- {
- throw new JspException("no parent UIComponentTag found");
- }
- if (!componentTag.getCreated())
- {
- return Tag.SKIP_BODY;
- }
-
- Converter converter = createConverter();
-
- UIComponent component = componentTag.getComponentInstance();
- if (component == null)
- {
- throw new JspException("parent UIComponentTag has no UIComponent");
- }
- if (!(component instanceof ValueHolder))
- {
- throw new JspException("UIComponent is no ValueHolder");
- }
- ((ValueHolder)component).setConverter(converter);
-
- return Tag.SKIP_BODY;
- }
-
- @Override
- public void release()
- {
- super.release();
- _converterId = null;
- _binding = null;
- }
-
- /**
- * @throws JspException
- */
- protected Converter createConverter() throws JspException
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Application application = facesContext.getApplication();
-
- return application.createConverter(_converterId);
-
- }
-
- /**
- * @throws JspException
- */
- public void setBinding(String binding) throws JspException
- {
- _binding = binding;
- }
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/FacetTag.java b/api/src/main/java/jakarta/faces/webapp/FacetTag.java
deleted file mode 100755
index 3080836..0000000
--- a/api/src/main/java/jakarta/faces/webapp/FacetTag.java
+++ /dev/null
@@ -1,67 +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 jakarta.faces.webapp;
-
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-/**
- * This tag adds its child as a facet of the nearest parent UIComponent. A child consisting of multiple elements should
- * be nested within a container component (i.e., within an h:panelGroup for HTML library components).
- *
- * Unless otherwise specified, all attributes accept static values or EL expressions.
- *
- * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
- *
- * @JSFJspTag name="f:facet" bodyContent="JSP"
- */
-public class FacetTag extends TagSupport
-{
- private static final long serialVersionUID = -5254277925259361302L;
- private String _name;
-
- public String getName()
- {
- return _name;
- }
-
- /**
- * The name of the facet to be created. This must be a static value.
- *
- * @JSFJspAttribute required="true"
- */
- public void setName(String name)
- {
- _name = name;
- }
-
- @Override
- public void release()
- {
- super.release();
- _name = null;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
- return EVAL_BODY_INCLUDE;
- }
-
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/UIComponentBodyTag.java b/api/src/main/java/jakarta/faces/webapp/UIComponentBodyTag.java
deleted file mode 100755
index 935d682..0000000
--- a/api/src/main/java/jakarta/faces/webapp/UIComponentBodyTag.java
+++ /dev/null
@@ -1,29 +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 jakarta.faces.webapp;
-
-/**
- * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
- *
- * @deprecated replaced by {@link UIComponentELTag}
- */
-public abstract class UIComponentBodyTag extends UIComponentTag
-{
-
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/UIComponentClassicTagBase.java b/api/src/main/java/jakarta/faces/webapp/UIComponentClassicTagBase.java
deleted file mode 100644
index 9174ed0..0000000
--- a/api/src/main/java/jakarta/faces/webapp/UIComponentClassicTagBase.java
+++ /dev/null
@@ -1,1348 +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 jakarta.faces.webapp;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.logging.Level;
-
-import jakarta.faces.component.NamingContainer;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.component.UIOutput;
-import jakarta.faces.component.UIViewRoot;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.render.ResponseStateManager;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.JspWriter;
-import jakarta.servlet.jsp.PageContext;
-import jakarta.servlet.jsp.jstl.core.LoopTag;
-import jakarta.servlet.jsp.tagext.BodyContent;
-import jakarta.servlet.jsp.tagext.BodyTag;
-import jakarta.servlet.jsp.tagext.JspIdConsumer;
-import jakarta.servlet.jsp.tagext.Tag;
-
-/**
- * @since 1.2
- */
-public abstract class UIComponentClassicTagBase extends UIComponentTagBase implements BodyTag, JspIdConsumer
-{
-
- // do not change this w/out doing likewise in UIComponentTag
- private static final String COMPONENT_STACK_ATTR = "org.apache.myfaces.COMPONENT_STACK";
-
- private static final String REQUEST_FACES_CONTEXT = "org.apache.myfaces.REQUEST_FACES_CONTEXT";
-
- private static final String VIEW_IDS = "org.apache.myfaces.VIEW_IDS";
-
- private static final String FORMER_CHILD_IDS_SET_ATTR = "org.apache.myfaces.FORMER_CHILD_IDS";
- private static final String FORMER_FACET_NAMES_SET_ATTR = "org.apache.myfaces.FORMER_FACET_NAMES";
-
- private static final String PREVIOUS_JSP_IDS_SET = "org.apache.myfaces.PREVIOUS_JSP_IDS_SET";
-
- private static final String BOUND_VIEW_ROOT = "org.apache.myfaces.BOUND_VIEW_ROOT";
-
- private static final String LOGICAL_PAGE_ID = "org.apache.myfaces.LOGICAL_PAGE_ID";
-
- private static final String LOGICAL_PAGE_COUNTER = "org.apache.myfaces.LOGICAL_PAGE_COUNTER";
-
- protected static final String UNIQUE_ID_PREFIX = UIViewRoot.UNIQUE_ID_PREFIX + '_';
-
- protected PageContext pageContext = null;
- protected BodyContent bodyContent = null;
-
- private boolean _created = false;
-
- private String _jspId = null;
- private String _facesJspId = null;
-
- private List<String> _childrenAdded = null;
- private List<String> _facetsAdded = null;
-
- private UIComponent _componentInstance = null;
- private String _id = null;
-
- private boolean isInAnIterator;
-
- // the parent tag
- private Tag _parent = null;
-
- // the enclosing "classic" parent tag
- private UIComponentClassicTagBase _parentClassicTag = null;
-
- private FacesContext _facesContext = null;
-
- protected abstract void setProperties(UIComponent component);
-
- protected abstract UIComponent createComponent(FacesContext context, String newId) throws JspException;
-
- @Override
- public void release()
- {
- internalRelease();
-
- // members, that must/need only be reset when there is no more risk, that the container
- // wants to reuse this tag
- pageContext = null;
- _parent = null;
- _jspId = null;
- _id = null;
- _facesJspId = null;
- bodyContent = null;
- }
-
- /**
- * Reset any members that apply to the according component instance and must not be reused if the container wants to
- * reuse this tag instance. This method is called when rendering for this tag is finished ( doEndTag() ) or when
- * released by the container.
- */
- private void internalRelease()
- {
- _facesContext = null;
- _componentInstance = null;
- _created = false;
-
- _childrenAdded = null;
- _facetsAdded = null;
- }
-
- @Override
- public boolean getCreated()
- {
- return _created;
- }
-
- protected List<String> getCreatedComponents()
- {
- return _childrenAdded;
- }
-
- public static UIComponentClassicTagBase getParentUIComponentClassicTagBase(PageContext pageContext)
- {
- Stack<UIComponentClassicTagBase> stack = getStack(pageContext);
-
- int size = stack.size();
-
- return size > 0 ? stack.get(size - 1) : null;
- }
-
- public String getJspId()
- {
- return _jspId;
- }
-
- @Override
- public void setJspId(String jspId)
- {
- // -= Leonardo Uribe =- The javadoc says the following about this method:
- //
- // 1. This method is called by the container before doStartTag().
- // 2. The argument is guaranteed to be unique within the page.
- //
- // Doing some tests it was found that the jspId generated in a
- // jsp:include are "reset", so if before call it it was id10
- // the tags inside jsp:include starts from id1 (really I suppose a
- // different counter is used), so if we assign this one
- // directly it is possible to cause duplicate id exceptions later.
- //
- // One problem is caused by f:view tag. This one is not included when
- // we check for duplicate id, so it is possible to assign to a component
- // in a jsp:include the id of the UIViewRoot instance and cause a
- // duplicate id exception when the view is saved.
- //
- // Checking the javadoc it was found the following note:
- //
- // "... IMPLEMENTATION NOTE: This method will detect where we are in an
- // include and assign a unique ID for each include in a particular 'logical page'.
- // This allows us to avoid possible duplicate ID situations for included pages
- // that have components without explicit IDs..."
- //
- // So we need to keep a counter per logical page or page context found.
- // It is assumed the first one should not be suffixed. The others needs to be
- // suffixed, so all generated ids of those pages are different. The final result
- // is that jsp:include works correctly.
- //
- // Note this implementation detail takes precedence over c:forEach tag. If a
- // jsp:include is inside a c:forEach, jsp:include takes precedence and the
- // iteration prefix is ignored. If a custom id is provided for a component,
- // it will throw duplicate id exception, because this code is "override"
- // by the custom id, and the iteration suffix only applies on generated ids.
- Integer logicalPageId = (Integer) pageContext.getAttribute(LOGICAL_PAGE_ID);
-
- if (logicalPageId != null)
- {
- if (logicalPageId == 1)
- {
- //Base case, just pass it unchanged
- _jspId = jspId;
- }
- else
- {
- // We are on a different page context, suffix it with the logicalPageId
- _jspId = jspId + "pc" + logicalPageId;
- }
- }
- else
- {
- Map<Object, Object> attributeMap = getFacesContext().getAttributes();
- AtomicInteger logicalPageCounter = (AtomicInteger) attributeMap.get(LOGICAL_PAGE_COUNTER);
-
- if (logicalPageCounter == null)
- {
- //We are processing the first component tag.
- logicalPageCounter = new AtomicInteger(1);
- logicalPageId = 1;
- attributeMap.put(LOGICAL_PAGE_COUNTER, logicalPageCounter);
- pageContext.setAttribute(LOGICAL_PAGE_ID, logicalPageId);
- }
- else
- {
- //We are on a different page context, so we need to assign and set.
- logicalPageId = logicalPageCounter.incrementAndGet();
- pageContext.setAttribute(LOGICAL_PAGE_ID, logicalPageId);
- _jspId = jspId + "pc" + logicalPageId;
- }
- }
- _facesJspId = null;
- checkIfItIsInAnIterator(_jspId);
- }
-
- @Override
- protected void addChild(UIComponent child)
- {
- if (_childrenAdded == null)
- {
- _childrenAdded = new ArrayList<String>();
- }
-
- _childrenAdded.add(child.getId());
- }
-
- @Override
- protected void addFacet(String name)
- {
- if (_facetsAdded == null)
- {
- _facetsAdded = new ArrayList<String>();
- }
-
- _facetsAdded.add(name);
- }
-
- /**
- * Return the UIComponent instance associated with this tag.
- *
- * @return a UIComponent, never null.
- */
- @Override
- public UIComponent getComponentInstance()
- {
- return _componentInstance;
- }
-
- @Override
- protected FacesContext getFacesContext()
- {
- if (_facesContext != null)
- {
- return _facesContext;
- }
-
- _facesContext = pageContext == null ? null : (FacesContext)pageContext.getAttribute(REQUEST_FACES_CONTEXT);
-
- if (_facesContext != null)
- {
- return _facesContext;
- }
-
- _facesContext = FacesContext.getCurrentInstance();
-
- if (_facesContext != null)
- {
- if (pageContext != null)
- {
- pageContext.setAttribute(REQUEST_FACES_CONTEXT, _facesContext);
- }
- return _facesContext;
- }
-
- // should never be reached
- throw new RuntimeException("FacesContext not found");
- }
-
- @Override
- protected int getIndexOfNextChildTag()
- {
- if (_childrenAdded == null)
- {
- return 0;
- }
-
- return _childrenAdded.size();
- }
-
- @Override
- public void setId(String id)
- {
- if (id != null && id.startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
- {
- throw new IllegalArgumentException("Id is non-null and starts with UIViewRoot.UNIQUE_ID_PREFIX: " + id);
- }
-
- _id = id;
- }
-
- /**
- * Return the id (if any) specified as an xml attribute on this tag.
- */
- protected String getId()
- {
- return _id;
- }
-
- protected String getFacesJspId()
- {
- if (_facesJspId == null)
- {
- if (_jspId != null)
- {
- _facesJspId = UNIQUE_ID_PREFIX + _jspId;
-
- if (isIdDuplicated(_facesJspId))
- {
- _facesJspId = createNextId(_facesJspId);
- }
- }
- else
- {
- _facesJspId = _facesContext.getViewRoot().createUniqueId();
- }
- }
-
- return _facesJspId;
- }
-
- @Override
- public void setBodyContent(BodyContent bodyContent)
- {
- this.bodyContent = bodyContent;
- }
-
- @Override
- public void doInitBody() throws JspException
- {
- // nothing by default
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public int doAfterBody() throws JspException
- {
- UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext);
-
- if (isRootTag(parentTag) || isInRenderedChildrenComponent(parentTag))
- {
- UIComponent verbatimComp = createVerbatimComponentFromBodyContent();
-
- if (verbatimComp != null)
- {
- List<String> childrenAddedIds =
- (List<String>)_componentInstance.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR);
-
- if (childrenAddedIds == null)
- {
- _componentInstance.getChildren().add(verbatimComp);
- }
- else
- {
- int index = _componentInstance.getChildCount();
- if (childrenAddedIds.size() == index)
- {
- // verbatim already present, replace it
- _componentInstance.getChildren().add(index - 1, verbatimComp);
- }
- else
- {
- _componentInstance.getChildren().add(verbatimComp);
- }
- }
-
- // also tell the parent-tag about the new component instance
- if (parentTag != null)
- {
- parentTag.addChild(verbatimComp);
- }
- }
- }
-
- return getDoAfterBodyValue();
- }
-
- /**
- * Standard method invoked by the JSP framework to inform this tag of the PageContext associated with the jsp page
- * currently being processed.
- */
- @Override
- public void setPageContext(PageContext pageContext)
- {
- this.pageContext = pageContext;
- }
-
- /**
- * Returns the enclosing JSP tag object. Note that this is not necessarily a JSF tag.
- */
- @Override
- public Tag getParent()
- {
- return _parent;
- }
-
- /**
- * Standard method invoked by the JSP framework to inform this tag of the enclosing JSP tag object.
- */
- @Override
- public void setParent(Tag tag)
- {
- this._parent = tag;
- }
-
- public BodyContent getBodyContent()
- {
- return bodyContent;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
- this._facesContext = getFacesContext();
-
- if (_facesContext == null)
- {
- throw new JspException("FacesContext not found");
- }
-
- _childrenAdded = null;
- _facetsAdded = null;
-
- _parentClassicTag = getParentUIComponentClassicTagBase(pageContext);
-
- UIComponent verbatimComp = null;
-
- // create the verbatim component if not inside a facet (facets are rendered
- // by their parents) and in a component that renders children
- if (!isFacet())
- {
- Tag parent = getParent();
-
- // flush if in a loop tag and not in a jsp tag
- if (parent != null && parent instanceof LoopTag)
- {
- JspWriter outWriter = pageContext.getOut();
- boolean insideJspTag = (outWriter instanceof BodyContent);
-
- if (!insideJspTag)
- {
- try
- {
- outWriter.flush();
- }
- catch (IOException e)
- {
- throw new JspException("Exception flushing when creating verbatim _componentInstance", e);
- }
- }
- }
-
- // create the transient _componentInstance
- if (_parentClassicTag != null)
- {
- verbatimComp = _parentClassicTag.createVerbatimComponentFromBodyContent();
- }
- }
-
- // find the _componentInstance for this tag
- _componentInstance = findComponent(_facesContext);
-
- // add the verbatim component
- if (verbatimComp != null && _parentClassicTag != null)
- {
- addVerbatimBeforeComponent(_parentClassicTag, verbatimComp, _componentInstance);
- }
-
- Map<String, Object> viewComponentIds = getViewComponentIds();
-
- // check that the instance returned by the client ID for the viewComponentIds
- // is the same like this one, so we do not perform again the check for duplicated ids
- Object tagInstance = null;
- String clientId = null;
- if (_id != null)
- {
- clientId = _componentInstance.getClientId(_facesContext);
- tagInstance = (viewComponentIds.get(clientId) == this) ? this : null;
- }
-
- if (tagInstance == null)
- {
- // check for duplicated IDs
- if (_id != null)
- {
- if (clientId != null)
- {
- if (viewComponentIds.containsKey(clientId))
- {
- throw new JspException("Duplicated component Id: '" + clientId + "' " + "for component: '"
- + getPathToComponent(_componentInstance) + "'.");
- }
-
- viewComponentIds.put(clientId, this);
- }
- }
-
- // add to the component or facet to parent
- if (_parentClassicTag != null)
- {
- if (isFacet())
- {
- _parentClassicTag.addFacet(getFacetName());
- }
- else
- {
- _parentClassicTag.addChild(_componentInstance);
- }
- }
- }
-
- // push this tag on the stack
- pushTag();
-
- return getDoStartValue();
- }
-
- @Override
- public int doEndTag() throws JspException
- {
- popTag();
- UIComponent component = getComponentInstance();
-
- removeFormerChildren(component);
- removeFormerFacets(component);
-
- try
- {
- UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext);
-
- UIComponent verbatimComp = createVerbatimComponentFromBodyContent();
-
- if (verbatimComp != null)
- {
- component.getChildren().add(verbatimComp);
-
- if (parentTag != null)
- {
- parentTag.addChild(verbatimComp);
- }
- }
- }
- catch (Throwable e)
- {
- throw new JspException(e);
- }
- finally
- {
- component = null;
- }
-
- int retValue = getDoEndValue();
-
- internalRelease();
-
- return retValue;
- }
-
- /**
- * @throws JspException
- */
- protected int getDoAfterBodyValue() throws JspException
- {
- return SKIP_BODY;
- }
-
- /**
- * Get the value to be returned by the doStartTag method to the JSP framework. Subclasses which wish to use the
- * inherited doStartTag but control whether the tag is permitted to contain nested tags or not can just override
- * this method to return Tag.SOME_CONSTANT.
- *
- * @return BodyTag.EVAL_BODY_BUFFERED
- * @throws JspException
- */
- protected int getDoStartValue() throws JspException
- {
- return BodyTag.EVAL_BODY_BUFFERED;
- }
-
- /**
- * Get the value to be returned by the doEndTag method to the JSP framework. Subclasses which wish to use the
- * inherited doEndTag but control whether the tag is permitted to contain nested tags or not can just override this
- * method to return Tag.SOME_CONSTANT.
- *
- * @return Tag.EVAL_PAGE
- * @throws JspException
- */
- protected int getDoEndValue() throws JspException
- {
- return Tag.EVAL_PAGE;
- }
-
- protected String getFacetName()
- {
- return isFacet() ? ((FacetTag)_parent).getName() : null;
- }
-
- /**
- * Creates a UIComponent from the BodyContent
- */
- protected UIComponent createVerbatimComponentFromBodyContent()
- {
- UIOutput verbatimComp = null;
-
- if (bodyContent != null)
- {
- String strContent = bodyContent.getString();
-
- if (strContent != null)
- {
- String trimmedContent = strContent.trim();
- if (trimmedContent.length() > 0 && !isComment(strContent))
- {
- verbatimComp = createVerbatimComponent();
- verbatimComp.setValue(strContent);
- }
- }
-
- bodyContent.clearBody();
- }
-
- return verbatimComp;
- }
-
- private static boolean isComment(String bodyContent)
- {
- return (bodyContent.startsWith("<!--") && bodyContent.endsWith("-->"));
- }
-
- /**
- * <p>
- * Creates a transient UIOutput using the Application, with the following characteristics:
- * </p>
- * <p>
- * <code>componentType</code> is <code>jakarta.faces.HtmlOutputText</code>.
- * </p>
- * <p>
- * <code>transient</code> is <code>true</code>.
- * </p>
- * <p>
- * <code>escape</code> is <code>false</code>.
- * </p>
- * <p>
- * <code>id</code> is <code>FacesContext.getViewRoot().createUniqueId()</code>
- * </p>
- */
- protected UIOutput createVerbatimComponent()
- {
- UIOutput verbatimComp =
- (UIOutput)getFacesContext().getApplication().createComponent("jakarta.faces.HtmlOutputText");
- verbatimComp.setTransient(true);
- verbatimComp.getAttributes().put("escape", Boolean.FALSE);
- verbatimComp.setId(getFacesContext().getViewRoot().createUniqueId());
-
- return verbatimComp;
- }
-
- @SuppressWarnings("unchecked")
- protected void addVerbatimBeforeComponent(UIComponentClassicTagBase parentTag, UIComponent verbatimComp,
- UIComponent component)
- {
- UIComponent parent = component.getParent();
-
- if (parent == null)
- {
- return;
- }
-
- List<UIComponent> children = parent.getChildren();
- // EDGE CASE:
- // Consider CASE 1 or 2 where the _componentInstance is provided via a
- // _componentInstance binding in session or application scope.
- // The automatically created UIOuput instances for the template text
- // will already be present. Check the JSP_CREATED_COMPONENT_IDS attribute,
- // if present and the number of created components is the same
- // as the number of children replace at a -1 offset from the current
- // value of indexOfComponentInParent, otherwise, call add()
-
- List<String> childrenAddedIds = (List<String>)parent.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR);
-
- int parentIndex = children.indexOf(component);
-
- if (childrenAddedIds != null)
- {
- if (parentIndex > 0 && childrenAddedIds.size() == parentIndex)
- {
- UIComponent formerVerbatim = children.get(parentIndex - 1);
-
- if (formerVerbatim instanceof UIOutput && formerVerbatim.isTransient())
- {
- children.set(parentIndex - 1, verbatimComp);
- }
- }
- }
-
- children.add(parentIndex, verbatimComp);
-
- parentTag.addChild(verbatimComp);
- }
-
- /**
- * <p>
- * Add <i>verbatim</i> as a sibling of <i>_componentInstance</i> in <i>_componentInstance</i> in the parent's child
- * list. <i>verbatim</i> is added to the list at the position immediatly following <i>_componentInstance</i>.
- * </p>
- */
-
- protected void addVerbatimAfterComponent(UIComponentClassicTagBase parentTag, UIComponent verbatim,
- UIComponent component)
- {
- int indexOfComponentInParent = 0;
- UIComponent parent = component.getParent();
-
- // invert the order of this if and the assignment below. Since this line is
- // here, it appears an early return is acceptable/desired if parent is null,
- // and, if it is null, we should probably check for that before we try to
- // access it. 2006-03-15 jdl
- if (null == parent)
- {
- return;
- }
- List<UIComponent> children = parent.getChildren();
- indexOfComponentInParent = children.indexOf(component);
- if (children.size() - 1 == indexOfComponentInParent)
- {
- children.add(verbatim);
- }
- else
- {
- children.add(indexOfComponentInParent + 1, verbatim);
- }
- parentTag.addChild(verbatim);
- }
-
- /**
- * @deprecated the ResponseWriter is now set by {@link jakarta.faces.application.ViewHandler#renderView}
- */
- protected void setupResponseWriter()
- {
- }
-
- /**
- * Invoke encodeBegin on the associated UIComponent. Subclasses can override this method to perform custom
- * processing before or after the UIComponent method invocation.
- */
- protected void encodeBegin() throws IOException
- {
- if (log.isLoggable(Level.FINE))
- {
- log.fine("Entered encodeBegin for client-Id: " + _componentInstance.getClientId(getFacesContext()));
- }
- _componentInstance.encodeBegin(getFacesContext());
- if (log.isLoggable(Level.FINE))
- {
- log.fine("Exited encodeBegin");
- }
- }
-
- /**
- * Invoke encodeChildren on the associated UIComponent. Subclasses can override this method to perform custom
- * processing before or after the UIComponent method invocation. This is only invoked for components whose
- * getRendersChildren method returns true.
- */
- protected void encodeChildren() throws IOException
- {
- if (log.isLoggable(Level.FINE))
- {
- log.fine("Entered encodeChildren for client-Id: " + _componentInstance.getClientId(getFacesContext()));
- }
- _componentInstance.encodeChildren(getFacesContext());
- if (log.isLoggable(Level.FINE))
- {
- log.fine("Exited encodeChildren for client-Id: " + _componentInstance.getClientId(getFacesContext()));
- }
- }
-
- /**
- * Invoke encodeEnd on the associated UIComponent. Subclasses can override this method to perform custom processing
- * before or after the UIComponent method invocation.
- */
- protected void encodeEnd() throws IOException
- {
- if (log.isLoggable(Level.FINE))
- {
- log.fine("Entered encodeEnd for client-Id: " + _componentInstance.getClientId(getFacesContext()));
- }
- _componentInstance.encodeEnd(getFacesContext());
- if (log.isLoggable(Level.FINE))
- {
- log.fine("Exited encodeEnd for client-Id: " + _componentInstance.getClientId(getFacesContext()));
- }
-
- }
-
- private boolean isRootTag(UIComponentClassicTagBase parentTag)
- {
- return (parentTag == this);
- }
-
- private boolean isInRenderedChildrenComponent(UIComponentClassicTagBase tag)
- {
- return (_parentClassicTag != null && tag.getComponentInstance().getRendersChildren());
- }
-
- private boolean isFacet()
- {
- return _parent != null && _parent instanceof FacetTag;
- }
-
- /** Map of <ID,Tag> in the view */
- @SuppressWarnings("unchecked")
- private Map<String, Object> getViewComponentIds()
- {
- Map<Object, Object> attributes = _facesContext.getAttributes();
- Map<String, Object> viewComponentIds;
-
- if (_parent == null)
- {
- // top level _componentInstance
- viewComponentIds = new HashMap<String, Object>();
- attributes.put(VIEW_IDS, viewComponentIds);
- }
- else
- {
- // Check if null, this can happen if someone programatically tries to do an include of a
- // JSP fragment. This code will prevent NullPointerException from happening in such cases.
- viewComponentIds = (Map<String, Object>) attributes.computeIfAbsent(VIEW_IDS,
- k -> new HashMap<String, Object>());
- }
-
- return viewComponentIds;
- }
-
- @SuppressWarnings("unchecked")
- private static Stack<UIComponentClassicTagBase> getStack(PageContext pageContext)
- {
- Stack<UIComponentClassicTagBase> stack =
- (Stack<UIComponentClassicTagBase>) pageContext.getAttribute(COMPONENT_STACK_ATTR,
- PageContext.REQUEST_SCOPE);
-
- if (stack == null)
- {
- stack = new Stack<UIComponentClassicTagBase>();
- pageContext.setAttribute(COMPONENT_STACK_ATTR, stack, PageContext.REQUEST_SCOPE);
- }
-
- return stack;
- }
-
- /**
- * The pageContext's request scope map is used to hold a stack of JSP tag objects seen so far, so that a new tag can
- * find the parent tag that encloses it. Access to the parent tag is used to find the parent UIComponent for the
- * component associated with this tag plus some other uses.
- */
- private void popTag()
- {
- Stack<UIComponentClassicTagBase> stack = getStack(pageContext);
-
- int size = stack.size();
- stack.remove(size - 1);
- if (size <= 1)
- {
- pageContext.removeAttribute(COMPONENT_STACK_ATTR, PageContext.REQUEST_SCOPE);
- }
-
- }
-
- private void pushTag()
- {
- getStack(pageContext).add(this);
- }
-
- /** Generate diagnostic output. */
- private 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();
- }
-
- /** Generate diagnostic output. */
- 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);
-
- getPathToComponent(component.getParent(), buf);
- }
-
- /**
- * Remove any child components of the associated components which do not have corresponding tags as children of this
- * tag. This only happens when a view is being re-rendered and there are components in the view tree which don't
- * have corresponding JSP tags. Wrapping JSF tags in JSTL "c:if" statements is one way this can happen. <br />
- * Attention: programmatically added components are are not affected by this: they will not be on the old list of
- * created components nor on the new list of created components, so nothing will happen to them.
- */
- @SuppressWarnings("unchecked")
- private void removeFormerChildren(UIComponent component)
- {
- List<String> formerChildIds = (List<String>)component.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR);
- if (formerChildIds != null)
- {
- for (String childId : formerChildIds)
- {
- if (_childrenAdded == null || !_childrenAdded.contains(childId))
- {
- UIComponent childToRemove = component.findComponent(childId);
- if (childToRemove != null)
- {
- component.getChildren().remove(childToRemove);
- }
- }
- }
- if (_childrenAdded == null)
- {
- component.getAttributes().remove(FORMER_CHILD_IDS_SET_ATTR);
- }
- else
- {
- component.getAttributes().put(FORMER_CHILD_IDS_SET_ATTR, _childrenAdded);
- }
- }
- else
- {
- if (_childrenAdded != null)
- {
- component.getAttributes().put(FORMER_CHILD_IDS_SET_ATTR, _childrenAdded);
- }
- }
- }
-
- /** See removeFormerChildren. */
- @SuppressWarnings("unchecked")
- private void removeFormerFacets(UIComponent component)
- {
- List<String> formerFacetNames = (List<String>)component.getAttributes().get(FORMER_FACET_NAMES_SET_ATTR);
- if (formerFacetNames != null)
- {
- for (String facetName : formerFacetNames)
- {
- if (_facetsAdded == null || !_facetsAdded.contains(facetName))
- {
- component.getFacets().remove(facetName);
- }
- }
- if (_facetsAdded == null)
- {
- component.getAttributes().remove(FORMER_FACET_NAMES_SET_ATTR);
- }
- else
- {
- component.getAttributes().put(FORMER_FACET_NAMES_SET_ATTR, _facetsAdded);
- }
- }
- else
- {
- if (_facetsAdded != null)
- {
- component.getAttributes().put(FORMER_FACET_NAMES_SET_ATTR, _facetsAdded);
- }
- }
- }
-
- /**
- * Return the corresponding UIComponent for this tag, creating it if necessary.
- * <p>
- * If this is not the first time this method has been called, then return the cached _componentInstance instance
- * found last time.
- * <p>
- * If this is not the first time this view has been seen, then locate the existing _componentInstance using the id
- * attribute assigned to this tag and return it. Note that this is simple for components with user-assigned ids. For
- * components with generated ids, the "reattachment" relies on the fact that UIViewRoot will generate the same id
- * values for tags in this page as it did when first generating the view. For this reason all JSF tags within a JSTL
- * "c:if" are required to have explicitly-assigned ids.
- * <p>
- * Otherwise create the _componentInstance, populate its properties from the xml attributes on this JSP tag and
- * attach it to its parent.
- * <p>
- * When a _componentInstance is found or created the parent JSP tag is also told that the _componentInstance has
- * been "seen". When the parent tag ends it will delete any components which were in the view previously but have
- * not been seen this time; see doEndTag for more details.
- */
- protected UIComponent findComponent(FacesContext context) throws JspException
- {
- // 1. If we have previously located this component, return it.
- if (_componentInstance != null)
- {
- return _componentInstance;
- }
-
- // 2. Locate the parent component by looking for a parent UIComponentTag instance,
- // and ask it for its component. If there is no parent UIComponentTag instance,
- // this tag represents the root component, so get it from the current Tree and return it.
- UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext);
- if (parentTag == null)
- {
- // This is the root
- _componentInstance = context.getViewRoot();
-
- // check if the view root is already bound to the tag
- Object alreadyBoundViewRootFlag = _componentInstance.getAttributes().get(BOUND_VIEW_ROOT);
- if (alreadyBoundViewRootFlag == null)
- {
- try
- {
- setProperties(_componentInstance);
- }
- catch (Throwable e)
- {
- throw new JspException(e);
- }
-
- if (_id != null)
- {
- _componentInstance.setId(_id);
- }
- else
- {
- _componentInstance.setId(getFacesJspId());
- }
- _componentInstance.getAttributes().put(BOUND_VIEW_ROOT, true);
- _created = true;
-
- }
- else if (hasBinding())
- {
- setProperties(_componentInstance);
- }
-
- return _componentInstance;
- }
-
- UIComponent parent = parentTag.getComponentInstance();
-
- if (parent == null)
- {
- throw new IllegalStateException("parent is null?");
- }
-
- String facetName = getFacetName();
- if (facetName != null)
- {
- // Facet
- String id = createUniqueId(context, parent);
- _componentInstance = parent.getFacet(facetName);
- if (_componentInstance == null)
- {
- _componentInstance = createComponent(context, id);
- _created = true;
- parent.getFacets().put(facetName, _componentInstance);
- }
- else
- {
- if (checkFacetNameOnParentExists(parentTag, facetName))
- {
- throw new IllegalStateException("facet '" + facetName
- + "' already has a child associated. current associated _componentInstance id: "
- + _componentInstance.getClientId(context) + " class: "
- + _componentInstance.getClass().getName());
- }
- }
-
- addFacetNameToParentTag(parentTag, facetName);
- return _componentInstance;
- }
-
- // Child
- //
- // Note that setProperties is called only when we create the
- // _componentInstance; on later passes, the attributes defined on the
- // JSP tag are set on this Tag object, but then completely
- // ignored.
-
- String id = createUniqueId(context, parent);
-
- // Warn users that this tag is about to find/steal the UIComponent
- // that has already been created for a sibling tag with the same id value .
- // _childrenAdded is a Set, and we will stomp over a past id when calling
- // addChildIdToParentTag.
- //
- // It would also be reasonable to throw an exception here rather than
- // just issue a warning as this is a pretty serious problem. However the
- // Sun RI just issues a warning...
- if (parentTag._childrenAdded != null && parentTag._childrenAdded.contains(id))
- {
- if (log.isLoggable(Level.WARNING))
- {
- log.warning("There is more than one JSF tag with an id : " + id);
- }
- }
-
- _componentInstance = findComponent(parent, id);
- if (_componentInstance == null)
- {
- _componentInstance = createComponent(context, id);
- if (id.equals(_componentInstance.getId()) )
- {
- _created = true;
- int index = parentTag.getIndexOfNextChildTag();
- if (index > parent.getChildCount())
- {
- index = parent.getChildCount();
- }
-
- List<UIComponent> children = parent.getChildren();
- children.add(index, _componentInstance);
- }
- // On weblogic portal using faces-adapter, the id set and the retrieved
- // one for <netuix:namingContainer> is different. The reason is
- // this custom solution for integrate jsf changes the id of the parent
- // component to allow the same native portlet to be allocated multiple
- // times in the same page
- else if (null == findComponent(parent,_componentInstance.getId()))
- {
- _created = true;
- int index = parentTag.getIndexOfNextChildTag();
- if (index > parent.getChildCount())
- {
- index = parent.getChildCount();
- }
-
- List<UIComponent> children = parent.getChildren();
- children.add(index, _componentInstance);
- }
- }
-
- return _componentInstance;
-
- }
-
- private UIComponent findComponent(UIComponent parent, String id)
- {
- for (UIComponent child : parent.getChildren())
- {
- if (child.getId() != null && child.getId().equals(id))
- {
- return child;
- }
- }
-
- return null;
- }
-
- private String createUniqueId(FacesContext context, UIComponent parent) throws JspException
- {
- String id = getId();
- if (id == null)
- {
- id = getFacesJspId();
- }
- else if (isIdDuplicated(id))
- {
- if (isInAnIterator)
- {
- setId(createNextId(id));
- id = getId();
- }
- else
- {
- if (parent != null)
- {
- UIComponent namingContainer;
-
- if (parent instanceof NamingContainer)
- {
- namingContainer = parent;
- }
- else
- {
- namingContainer = parent.getParent();
- }
-
- if (namingContainer != null)
- {
- UIComponent component = namingContainer.findComponent(id);
-
- if (component == null || isPostBack(context))
- {
- return id;
- }
- }
- }
-
- throw new JspException("Duplicated Id found in the view: " + id);
- }
- }
-
- return id;
- }
-
- private String createNextId(String componentId)
- {
- Integer currentCounter = (Integer) getFacesContext().getAttributes().get(componentId);
-
- int iCurrentCounter = 1;
-
- if (currentCounter != null)
- {
- iCurrentCounter = currentCounter;
- iCurrentCounter++;
- }
-
- getFacesContext().getAttributes().put(componentId, iCurrentCounter);
-
- componentId = componentId + UNIQUE_ID_PREFIX + iCurrentCounter;
-
- return componentId;
- }
-
- private void checkIfItIsInAnIterator(String jspId)
- {
- Set<String> previousJspIdsSet = getPreviousJspIdsSet();
-
- if (previousJspIdsSet.contains(jspId))
- {
- isInAnIterator = true;
- }
- else
- {
- previousJspIdsSet.add(jspId);
- isInAnIterator = false;
- }
- }
-
- @SuppressWarnings("unchecked")
- private Set<String> getPreviousJspIdsSet()
- {
- // Add it to the context! The next time is called
- // this method it takes the ref from the RequestContext
- return (Set<String>)getFacesContext().getAttributes().computeIfAbsent(PREVIOUS_JSP_IDS_SET,
- k -> new HashSet<>());
- }
-
- private boolean isIdDuplicated(String componentId)
- {
- boolean result = false;
- if (_parentClassicTag != null)
- {
- if (_parentClassicTag.isInAnIterator)
- {
- return true;
- }
-
- List<String> childComponents = _parentClassicTag.getCreatedComponents();
- if (childComponents != null)
- {
- result = childComponents.contains(componentId);
- if (result && (!isInAnIterator))
- {
- return true;
- }
- }
- }
-
- return result;
- }
-
- private boolean isPostBack(FacesContext facesContext)
- {
- return facesContext.getExternalContext().getRequestParameterMap().containsKey(
- ResponseStateManager.VIEW_STATE_PARAM);
- }
-
- /**
- * check if the facet is already added to the parent
- */
- private boolean checkFacetNameOnParentExists(UIComponentClassicTagBase parentTag, String facetName)
- {
- return parentTag._facetsAdded != null && parentTag._facetsAdded.contains(facetName);
- }
-
- /**
- * Notify the enclosing JSP tag of the id of this facet's id. The parent tag will later delete any existing view
- * facets that were not seen during this rendering phase; see doEndTag for details.
- */
- private void addFacetNameToParentTag(UIComponentClassicTagBase parentTag, String facetName)
- {
- if (parentTag._facetsAdded == null)
- {
- parentTag._facetsAdded = new ArrayList<>();
- }
- parentTag._facetsAdded.add(facetName);
- }
-
- protected abstract boolean hasBinding();
-
- public JspWriter getPreviousOut()
- {
- return bodyContent.getEnclosingWriter();
- }
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/UIComponentELTag.java b/api/src/main/java/jakarta/faces/webapp/UIComponentELTag.java
deleted file mode 100644
index f81387e..0000000
--- a/api/src/main/java/jakarta/faces/webapp/UIComponentELTag.java
+++ /dev/null
@@ -1,134 +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 jakarta.faces.webapp;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.application.Application;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * Base class for all JSP tags that represent a JSF UIComponent.
- * <p>
- * <i>Disclaimer</i>: The official definition for the behaviour of this class is the JSF specification but for legal
- * reasons the specification cannot be replicated here. Any javadoc present on this class therefore describes the
- * current implementation rather than the officially required behaviour, though it is believed that this class does
- * comply with the specification.
- *
- * see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a> for
- * more.
- *
- * @since 1.2
- */
-public abstract class UIComponentELTag extends UIComponentClassicTagBase
-{
-
- private ValueExpression _binding = null;
- private ValueExpression _rendered = null;
-
- public UIComponentELTag()
- {
-
- }
-
- @Override
- protected ELContext getELContext()
- {
- FacesContext facesContext = getFacesContext();
- ELContext elContext = null;
- if (facesContext != null)
- {
- elContext = facesContext.getELContext();
- }
- return elContext;
- }
-
- @Override
- public void release()
- {
- super.release();
- _binding = null;
- _rendered = null;
- }
-
- @Override
- protected void setProperties(UIComponent component)
- {
- if (getRendererType() != null)
- {
- component.setRendererType(getRendererType());
- }
-
- if (_rendered != null)
- {
- if (_rendered.isLiteralText())
- {
- boolean b = Boolean.parseBoolean(_rendered.getExpressionString());
- component.setRendered(b);
- }
- else
- {
- component.setValueExpression("rendered", _rendered);
- }
- }
- }
-
- @Override
- protected UIComponent createComponent(FacesContext context, String newId) throws JspException
- {
- UIComponent component;
- Application application = context.getApplication();
-
- if (_binding != null)
- {
- component = application.createComponent(_binding, context, getComponentType());
- component.setValueExpression("binding", _binding);
- }
- else
- {
- component = application.createComponent(getComponentType());
- }
-
- component.setId(newId);
- setProperties(component);
-
- return component;
- }
-
- /**
- * @throws JspException
- */
- public void setBinding(ValueExpression binding) throws JspException
- {
- _binding = binding;
- }
-
- @Override
- protected boolean hasBinding()
- {
- return _binding != null;
- }
-
- public void setRendered(ValueExpression rendered)
- {
- _rendered = rendered;
- }
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/UIComponentTag.java b/api/src/main/java/jakarta/faces/webapp/UIComponentTag.java
deleted file mode 100755
index 4089ced..0000000
--- a/api/src/main/java/jakarta/faces/webapp/UIComponentTag.java
+++ /dev/null
@@ -1,339 +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 jakarta.faces.webapp;
-
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.PageContext;
-import jakarta.servlet.jsp.tagext.Tag;
-
-/**
- * Base class for all JSP tags that represent a JSF UIComponent.
- * <p>
- * <i>Disclaimer</i>: The official definition for the behaviour of this class is the JSF specification but for legal
- * reasons the specification cannot be replicated here. Any javadoc present on this class therefore describes the
- * current implementation rather than the officially required behaviour, though it is believed that this class does
- * comply with the specification.
- *
- * see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a> for
- * more.
- *
- * @deprecated replaced by {@link UIComponentELTag}
- */
-public abstract class UIComponentTag extends UIComponentClassicTagBase
-{
-
- // tag attributes
- private String _binding = null;
- private String _rendered = null;
-
- private Boolean _suppressed = null;
-
- public UIComponentTag()
- {
-
- }
-
- @Override
- public void release()
- {
- super.release();
-
- _binding = null;
- _rendered = null;
- }
-
- /** Setter for common JSF xml attribute "binding".
- * @throws JspException
- */
- public void setBinding(String binding) throws JspException
- {
- if (!isValueReference(binding))
- {
- throw new IllegalArgumentException("not a valid binding: " + binding);
- }
- _binding = binding;
- }
-
- /** Setter for common JSF xml attribute "rendered". */
- public void setRendered(String rendered)
- {
- _rendered = rendered;
- }
-
- /**
- * Return the nearest JSF tag that encloses this tag.
- *
- * @deprecated
- */
- public static UIComponentTag getParentUIComponentTag(PageContext pageContext)
- {
- UIComponentClassicTagBase parentTag = getParentUIComponentClassicTagBase(pageContext);
-
- return parentTag instanceof UIComponentTag ? (UIComponentTag)parentTag : new UIComponentTagWrapper(parentTag);
-
- }
-
- /**
- * Return true if the specified string contains an EL expression.
- * <p>
- * UIComponent properties are often required to be value-binding expressions; this method allows code to check
- * whether that is the case or not.
- */
- public static boolean isValueReference(String value)
- {
- if (value == null)
- {
- throw new NullPointerException("value");
- }
-
- int start = value.indexOf("#{");
- if (start < 0)
- {
- return false;
- }
-
- int end = value.lastIndexOf('}');
- return (end >= 0 && start < end);
- }
-
- /**
- * Create a UIComponent. Abstract method getComponentType is invoked to determine the actual type name for the
- * component to be created.
- *
- * If this tag has a "binding" attribute, then that is immediately evaluated to store the created component in the
- * specified property.
- */
- @Override
- protected UIComponent createComponent(FacesContext context, String id)
- {
- String componentType = getComponentType();
- if (componentType == null)
- {
- throw new NullPointerException("componentType");
- }
-
- UIComponent component = context.getApplication().createComponent(componentType);
- component.setId(id);
- setProperties(component);
-
- return component;
-
- }
-
- private boolean isFacet()
- {
- return getParent() != null && getParent() instanceof FacetTag;
- }
-
- /**
- * Determine whether this component renders itself. A component is "suppressed" when it is either not rendered, or
- * when it is rendered by its parent component at a time of the parent's choosing.
- */
- protected boolean isSuppressed()
- {
- if (_suppressed == null)
- {
- // we haven't called this method before, so determine the suppressed
- // value and cache it for later calls to this method.
-
- if (isFacet())
- {
- // facets are always rendered by their parents --> suppressed
- _suppressed = Boolean.TRUE;
- return true;
- }
-
- UIComponent component = getComponentInstance();
-
- // Does any parent render its children?
- // (We must determine this first, before calling any isRendered method
- // because rendered properties might reference a data var of a nesting UIData,
- // which is not set at this time, and would cause a VariableResolver error!)
- UIComponent parent = component.getParent();
- while (parent != null)
- {
- if (parent.getRendersChildren())
- {
- // Yes, parent found, that renders children --> suppressed
- _suppressed = Boolean.TRUE;
- return true;
- }
- parent = parent.getParent();
- }
-
- // does component or any parent has a false rendered attribute?
- while (component != null)
- {
- if (!component.isRendered())
- {
- // Yes, component or any parent must not be rendered --> suppressed
- _suppressed = Boolean.TRUE;
- return true;
- }
- component = component.getParent();
- }
-
- // else --> not suppressed
- _suppressed = Boolean.FALSE;
- }
- return _suppressed;
- }
-
- @Override
- protected void setProperties(UIComponent component)
- {
- if (getRendererType() != null)
- {
- component.setRendererType(getRendererType());
- }
-
- if (_rendered != null)
- {
- boolean b = Boolean.parseBoolean(_rendered);
- component.setRendered(b);
- }
- }
-
- /**
- * Class used to create an UIComponentTag from a UIComponentClassicTagBase.
- * <p>
- * This is a standard use of the decorator pattern, to make the logic of the JSF12 UIComponentClassicTagBase class
- * available via the old JSF11 UIComponentTag api.
- */
- private static class UIComponentTagWrapper extends UIComponentTag
- {
- private UIComponentClassicTagBase target;
-
- public UIComponentTagWrapper(UIComponentClassicTagBase classicTag)
- {
- target = classicTag;
- }
-
- // -----------------------------------------------------------
- // Methods that can reasonably be called on a parent tag object
- // -----------------------------------------------------------
-
- @Override
- public String getComponentType()
- {
- return target.getComponentType();
- }
-
- @Override
- public String getRendererType()
- {
- return target.getRendererType();
- }
-
- @Override
- public boolean getCreated()
- {
- return target.getCreated();
- }
-
- @Override
- public String getId()
- {
- return target.getId();
- }
-
- @Override
- public UIComponent getComponentInstance()
- {
- return target.getComponentInstance();
- }
-
- @Override
- public Tag getParent()
- {
- return target.getParent();
- }
-
- // -----------------------------------------------------------
- // Methods that should never be called on a parent tag object
- // -----------------------------------------------------------
-
- @Override
- public void release()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setBinding(String binding) throws JspException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setId(String id)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setRendered(String state)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected UIComponent createComponent(FacesContext context, String newId)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setPageContext(PageContext context)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setParent(Tag parent)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected UIComponent findComponent(FacesContext context) throws JspException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected FacesContext getFacesContext()
- {
- throw new UnsupportedOperationException();
- }
-
- // Methods that no sane user of this class would call, so we do not need to override here:
- // doStartTag, doEndTag, getDoStartValue, getDoEndValue, isSupressed
- // encodeBegin, encodeChildren, encodeEnd, getFacetName
- // setProperties, setupResponseWriter
- }
-
- @Override
- protected boolean hasBinding()
- {
- return _binding != null;
- }
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/UIComponentTagBase.java b/api/src/main/java/jakarta/faces/webapp/UIComponentTagBase.java
deleted file mode 100644
index f403226..0000000
--- a/api/src/main/java/jakarta/faces/webapp/UIComponentTagBase.java
+++ /dev/null
@@ -1,108 +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 jakarta.faces.webapp;
-
-import java.util.logging.Logger;
-
-import jakarta.el.ELContext;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.servlet.jsp.tagext.JspTag;
-
-/**
- * @since 1.2
- */
-
-public abstract class UIComponentTagBase extends Object implements JspTag
-{
- protected static final Logger log = Logger.getLogger("jakarta.faces.webapp");
-
- protected abstract void addChild(UIComponent child);
-
- protected abstract void addFacet(String name);
-
- public abstract UIComponent getComponentInstance();
-
- /**
- * Specify the "component type name" used together with the component's
- * family and the Application object to create a UIComponent instance for
- * this tag. This method is called by other methods in this class, and is
- * intended to be overridden in subclasses to specify the actual component
- * type to be created.
- *
- * @return a registered component type name, never null.
- */
-
- public abstract String getComponentType();
-
- /**
- * @return
- */
-
- public abstract boolean getCreated();
-
- /**
- * @return
- */
-
- protected ELContext getELContext()
- {
-
- FacesContext ctx = getFacesContext();
-
- if (ctx == null)
- {
- throw new NullPointerException("FacesContext ctx");
- }
-
- return getFacesContext().getELContext();
- }
-
- /**
- * @return
- */
-
- protected abstract FacesContext getFacesContext();
-
- /**
- * @return
- */
-
- protected abstract int getIndexOfNextChildTag();
-
- /**
- * Specify the "renderer type name" used together with the current
- * renderKit to get a Renderer instance for the corresponding UIComponent.
- * <p>
- * A JSP tag can return null here to use the default renderer type string.
- * If non-null is returned, then the UIComponent's setRendererType method
- * will be called passing this value, and this will later affect the
- * type of renderer object returned by UIComponent.getRenderer().
- *
- * @return
- */
- public abstract String getRendererType();
-
- /**
- * @param id
- */
-
- public abstract void setId(String id);
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/ValidatorELTag.java b/api/src/main/java/jakarta/faces/webapp/ValidatorELTag.java
deleted file mode 100644
index 5bb67b7..0000000
--- a/api/src/main/java/jakarta/faces/webapp/ValidatorELTag.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 jakarta.faces.webapp;
-
-import jakarta.faces.component.EditableValueHolder;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.validator.Validator;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-public abstract class ValidatorELTag extends TagSupport
-{
- private static final long serialVersionUID = 8794036166323016663L;
-
- @Override
- public int doStartTag() throws JspException
- {
- UIComponentClassicTagBase componentTag = UIComponentELTag.getParentUIComponentClassicTagBase(pageContext);
- if (componentTag == null)
- {
- throw new JspException("no parent UIComponentTag found");
- }
- if (!componentTag.getCreated())
- {
- return Tag.SKIP_BODY;
- }
-
- Validator validator = createValidator();
-
- UIComponent component = componentTag.getComponentInstance();
- if (component == null)
- {
- throw new JspException("parent UIComponentTag has no UIComponent");
- }
- if (!(component instanceof EditableValueHolder))
- {
- throw new JspException("UIComponent is no EditableValueHolder");
- }
- ((EditableValueHolder)component).addValidator(validator);
-
- return Tag.SKIP_BODY;
- }
-
- protected abstract Validator createValidator() throws JspException;
-
-}
diff --git a/api/src/main/java/jakarta/faces/webapp/ValidatorTag.java b/api/src/main/java/jakarta/faces/webapp/ValidatorTag.java
deleted file mode 100755
index 17777fe..0000000
--- a/api/src/main/java/jakarta/faces/webapp/ValidatorTag.java
+++ /dev/null
@@ -1,110 +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 jakarta.faces.webapp;
-
-import jakarta.faces.application.Application;
-import jakarta.faces.component.EditableValueHolder;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.validator.Validator;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-/**
- * see Javadoc of <a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>
- *
- * @deprecated replaced by {@link ValidatorELTag}
- */
-public class ValidatorTag extends TagSupport
-{
- private static final long serialVersionUID = 8794036166323016663L;
- private String _validatorId;
- private String _binding;
-
- public void setValidatorId(String validatorId)
- {
- _validatorId = validatorId;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
- UIComponentTag componentTag = UIComponentTag.getParentUIComponentTag(pageContext);
- if (componentTag == null)
- {
- throw new JspException("no parent UIComponentTag found");
- }
- if (!componentTag.getCreated())
- {
- return Tag.SKIP_BODY;
- }
-
- Validator validator = createValidator();
-
- UIComponent component = componentTag.getComponentInstance();
- if (component == null)
- {
- throw new JspException("parent UIComponentTag has no UIComponent");
- }
- if (!(component instanceof EditableValueHolder))
- {
- throw new JspException("UIComponent is no ValueHolder");
- }
- ((EditableValueHolder)component).addValidator(validator);
-
- return Tag.SKIP_BODY;
- }
-
- @Override
- public void release()
- {
- super.release();
- _validatorId = null;
- _binding = null;
- }
-
- /**
- * @throws JspException
- */
- protected Validator createValidator() throws JspException
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Application application = facesContext.getApplication();
-
- return application.createValidator(_validatorId);
-
- }
-
- /**
- *
- * @param binding
- * @throws jakarta.servlet.jsp.JspException
- *
- * @deprecated
- */
- public void setBinding(java.lang.String binding) throws jakarta.servlet.jsp.JspException
- {
- if (binding != null && !UIComponentTag.isValueReference(binding))
- {
- throw new IllegalArgumentException("not a valid binding: " + binding);
- }
- _binding = binding;
- }
-}
diff --git a/impl/pom.xml b/impl/pom.xml
index a5cd8ff..df003eb 100644
--- a/impl/pom.xml
+++ b/impl/pom.xml
@@ -172,21 +172,6 @@
<goal>make-components</goal>
</goals>
</execution>
- <execution>
- <id>make_tags</id>
- <configuration>
- <jsfVersion>12</jsfVersion>
- <templateTagName>tagClass12.vm</templateTagName>
- <packageContains>org.apache</packageContains>
- <typePrefix>jakarta.faces</typePrefix>
- <modelIds>
- <modelId>myfaces-api</modelId>
- </modelIds>
- </configuration>
- <goals>
- <goal>make-tags</goal>
- </goals>
- </execution>
<execution>
<id>makecoretld</id>
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ActionListenerTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ActionListenerTag.java
deleted file mode 100755
index 626ba3b..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ActionListenerTag.java
+++ /dev/null
@@ -1,80 +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.taglib.core;
-
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.ActionSource;
-import jakarta.faces.event.ActionListener;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-
-/**
- * This tag creates an instance of the specified ActionListener, and associates it with the nearest parent UIComponent.
- * <p>
- * Unless otherwise specified, all attributes accept static values or EL expressions.
- * </p>
- *
- * @author Manfred Geiler (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-@JSFJspTag(name = "f:actionListener", bodyContent = "empty")
-public class ActionListenerTag extends GenericListenerTag<ActionSource, ActionListener>
-{
- private static final long serialVersionUID = -2021978765020549175L;
-
- public ActionListenerTag()
- {
- super(ActionSource.class);
- }
-
- @Override
- protected void addListener(ActionSource actionSource, ActionListener actionListener)
- {
- actionSource.addActionListener(actionListener);
- }
-
- @Override
- protected ActionListener createDelegateListener(ValueExpression type, ValueExpression binding)
- {
- return new DelegateActionListener(type, binding);
- }
-
- /**
- * The fully qualified class name of the ActionListener class.
- */
- @Override
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.String")
- public void setType(ValueExpression type)
- {
- super.setType(type);
- }
-
- /**
- * Value binding expression that evaluates to an object that implements jakarta.faces.event.ActionListener.
- */
- @Override
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="jakarta.faces.event.ActionListener")
- public void setBinding(ValueExpression binding)
- {
- super.setBinding(binding);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/AttributeTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/AttributeTag.java
deleted file mode 100644
index 7705b43..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/AttributeTag.java
+++ /dev/null
@@ -1,146 +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.taglib.core;
-
-import jakarta.servlet.jsp.tagext.TagSupport;
-import jakarta.servlet.jsp.JspException;
-import jakarta.faces.webapp.UIComponentClassicTagBase;
-import jakarta.faces.webapp.UIComponentELTag;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.el.ValueExpression;
-import jakarta.el.ELContext;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-
-/**
- * This tag associates an attribute with the nearest parent UIComponent.
- * <p>
- * When the value is not an EL expression, this tag has the same effect as calling component.getAttributes.put(name,
- * value). When the attribute name specified matches a standard property of the component, that property is set. However
- * it is also valid to assign attributes to components using any arbitrary name; the component itself won't make any use
- * of these but other objects such as custom renderers, validators or action listeners can later retrieve the attribute
- * from the component by name.
- * </p>
- * <p>
- * When the value is an EL expression, this tag has the same effect as calling component.setValueBinding. A call to
- * method component.getAttributes().get(name) will then cause that expression to be evaluated and the result of the
- * expression is returned, not the original EL expression string.
- * </p>
- * <p>
- * See the javadoc for UIComponent.getAttributes for more details.
- * </p>
- * <p>
- * Unless otherwise specified, all attributes accept static values or EL expressions.
- * </p>
- *
- * @author Manfred Geiler (latest modification by $Author$)
- * @author Bruno Aranda (JSR-252)
- * @version $Revision$ $Date$
- */
-@JSFJspTag(name = "f:attribute", bodyContent = "empty")
-public class AttributeTag extends TagSupport
-{
- private static final long serialVersionUID = 31476300171678632L;
- private ValueExpression _nameExpression;
- private ValueExpression _valueExpression;
-
- /**
- * The name of the attribute.
- *
- * @param nameExpression
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.String")
- public void setName(ValueExpression nameExpression)
- {
- _nameExpression = nameExpression;
- }
-
- /**
- * The attribute's value.
- *
- * @param valueExpression
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.Object")
- public void setValue(ValueExpression valueExpression)
- {
- _valueExpression = valueExpression;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
- UIComponentClassicTagBase componentTag = UIComponentELTag.getParentUIComponentClassicTagBase(pageContext);
- if (componentTag == null)
- {
- throw new JspException("no parent UIComponentTag found");
- }
- UIComponent component = componentTag.getComponentInstance();
- if (component == null)
- {
- throw new JspException("parent UIComponentTag has no UIComponent");
- }
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
-
- String name = null;
- Object value = null;
- boolean isLiteral = false;
-
- if (_nameExpression != null)
- {
- name = (String)_nameExpression.getValue(elContext);
- }
-
- if (_valueExpression != null)
- {
- isLiteral = _valueExpression.isLiteralText();
- value = _valueExpression.getValue(elContext);
- }
-
- if (name != null)
- {
- if (component.getAttributes().get(name) == null)
- {
- if (isLiteral)
- {
- component.getAttributes().put(name, value);
- }
- else
- {
- component.setValueExpression(name, _valueExpression);
- }
- }
- }
-
- return SKIP_BODY;
- }
-
- @Override
- public void release()
- {
- super.release();
- _nameExpression = null;
- _valueExpression = null;
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertDateTimeTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertDateTimeTag.java
deleted file mode 100755
index 94393a1..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertDateTimeTag.java
+++ /dev/null
@@ -1,303 +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.taglib.core;
-
-import org.apache.myfaces.util.LocaleUtils;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.convert.Converter;
-import jakarta.faces.convert.DateTimeConverter;
-import jakarta.servlet.jsp.JspException;
-import java.util.Locale;
-import java.util.TimeZone;
-
-/**
- * @author Manfred Geiler (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-public class ConvertDateTimeTag extends ConverterTag
-{
-
- /**
- * serial version id for correct serialisation versioning
- */
- private static final long serialVersionUID = 54366768002181L;
-
- private static final String DEFAULT_DATE_STYLE = "default";
- private static final String DEFAULT_TIME_STYLE = "default";
-
- private static final String TYPE_DATE = "date";
- private static final String TYPE_TIME = "time";
- private static final String TYPE_BOTH = "both";
-
- private static final String DEFAULT_TYPE = TYPE_DATE;
-
- private ValueExpression _dateStyle;
- private ValueExpression _locale;
- private ValueExpression _pattern;
- private ValueExpression _timeStyle;
- private ValueExpression _timeZone;
- private ValueExpression _type;
-
- private static final ValueExpression CONVERTER_ID;
-
- static
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- if (facesContext != null)
- {
- CONVERTER_ID =
- facesContext.getApplication().getExpressionFactory().createValueExpression(
- facesContext.getELContext(), "jakarta.faces.DateTime", String.class);
- }
- else
- {
- // Handle null facesContext because some tools (eg the tlddoc generator)
- // load classes in order to introspect them. Of course this class will
- // never work correctly in its normal JSF environment if this case is used.
- CONVERTER_ID = null;
- }
- }
-
- @Override
- public void release()
- {
- super.release();
- _dateStyle = null;
- _locale = null;
- _pattern = null;
- _timeStyle = null;
- _timeZone = null;
- _type = null;
- }
-
- public void setDateStyle(ValueExpression dateStyle)
- {
- _dateStyle = dateStyle;
- }
-
- public void setLocale(ValueExpression locale)
- {
- _locale = locale;
- }
-
- public void setPattern(ValueExpression pattern)
- {
- _pattern = pattern;
- }
-
- public void setTimeStyle(ValueExpression timeStyle)
- {
- _timeStyle = timeStyle;
- }
-
- public void setTimeZone(ValueExpression timeZone)
- {
- _timeZone = timeZone;
- }
-
- public void setType(ValueExpression type)
- {
- _type = type;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
- super.setConverterId(CONVERTER_ID);
- return super.doStartTag();
- }
-
- @Override
- protected Converter createConverter() throws JspException
- {
- DateTimeConverter converter = (DateTimeConverter)super.createConverter();
-
- ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- setConverterDateStyle(elContext, converter, _dateStyle);
- setConverterLocale(elContext, converter, _locale);
- setConverterPattern(elContext, converter, _pattern);
- setConverterTimeStyle(elContext, converter, _timeStyle);
- setConverterTimeZone(elContext, converter, _timeZone);
- setConverterType(elContext, converter, _type);
-
- return converter;
- }
-
- private void setConverterLocale(ELContext eLContext, DateTimeConverter converter, ValueExpression value)
- {
- if (value == null)
- {
- return;
- }
-
- Object objLocale = UIComponentELTagUtils.evaluateValueExpression(eLContext, value);
- Locale locale;
-
- if (objLocale == null)
- {
- return;
- }
-
- if (objLocale instanceof Locale)
- {
- locale = (Locale)objLocale;
- }
- else
- {
- locale = LocaleUtils.toLocale(objLocale.toString());
- }
- converter.setLocale(locale);
- }
-
- private void setConverterDateStyle(ELContext elContext, DateTimeConverter converter, ValueExpression value)
- {
- if (value == null)
- {
- return;
- }
-
- String dateStyle = (String)UIComponentELTagUtils.evaluateValueExpression(elContext, value);
-
- if (dateStyle == null)
- {
- dateStyle = DEFAULT_DATE_STYLE;
- }
-
- converter.setDateStyle(dateStyle);
- }
-
- private void setConverterPattern(ELContext elContext, DateTimeConverter converter, ValueExpression value)
- {
- if (value == null)
- {
- return;
- }
-
- String pattern = (String)UIComponentELTagUtils.evaluateValueExpression(elContext, value);
- converter.setPattern(pattern);
- }
-
- private void setConverterTimeStyle(ELContext elContext, DateTimeConverter converter, ValueExpression value)
- {
- if (value == null)
- {
- return;
- }
-
- String timeStyle = (String)UIComponentELTagUtils.evaluateValueExpression(elContext, value);
-
- if (timeStyle == null)
- {
- timeStyle = DEFAULT_TIME_STYLE;
- }
-
- converter.setTimeStyle(timeStyle);
- }
-
- private void setConverterTimeZone(ELContext elContext, DateTimeConverter converter, ValueExpression value)
- {
- if (value == null)
- {
- return;
- }
-
- Object objTimeZone = UIComponentELTagUtils.evaluateValueExpression(elContext, value);
- TimeZone timeZone;
-
- if (objTimeZone == null)
- {
- return;
- }
-
- if (objTimeZone instanceof TimeZone)
- {
- timeZone = (TimeZone)objTimeZone;
- }
- else
- {
- timeZone = TimeZone.getTimeZone(objTimeZone.toString());
- }
- converter.setTimeZone(timeZone);
- }
-
- private void setConverterType(ELContext elContext, DateTimeConverter converter, ValueExpression value)
- {
- String type;
-
- if (value == null)
- {
- type = null;
- }
- else
- {
- type = (String)UIComponentELTagUtils.evaluateValueExpression(elContext, value);
- }
-
- if (type == null)
- {
- // Now check the conditions on the spec, for type is not defined
- // page 9-20
- String timeStyle =
- (_timeStyle == null) ? null : (String)UIComponentELTagUtils.evaluateValueExpression(elContext,
- _timeStyle);
- String dateStyle =
- (_dateStyle == null) ? null : (String)UIComponentELTagUtils.evaluateValueExpression(elContext,
- _dateStyle);
- if (dateStyle == null)
- {
- if (timeStyle == null)
- {
- // if none type defaults to DEFAULT_TYPE
- type = DEFAULT_TYPE;
- }
- else
- {
- // if timeStyle is set and dateStyle is not, type defaults to TYPE_TIME
- type = TYPE_TIME;
- }
- }
- else
- {
- if (timeStyle == null)
- {
- // if dateStyle is set and timeStyle is not, type defaults to TYPE_DATE
- type = TYPE_DATE;
- }
- else
- {
- // if both dateStyle and timeStyle are set, type defaults to TYPE_BOTH
- type = TYPE_BOTH;
- }
- }
- }
- else
- {
- if (!TYPE_DATE.equals(type) && !TYPE_TIME.equals(type) && !TYPE_BOTH.equals(type))
- {
- type = DEFAULT_TYPE;
- }
- }
-
- converter.setType(type);
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java
deleted file mode 100755
index d3996fe..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ConvertNumberTag.java
+++ /dev/null
@@ -1,203 +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.taglib.core;
-
-import org.apache.myfaces.util.LocaleUtils;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.convert.Converter;
-import jakarta.faces.convert.NumberConverter;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.PageContext;
-import java.util.Locale;
-
-/**
- * @author Manfred Geiler (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-public class ConvertNumberTag extends ConverterTag
-{
- private static final long serialVersionUID = -8365745569697171573L;
- private ValueExpression _currencyCode = null;
- private ValueExpression _currencySymbol = null;
- private ValueExpression _groupingUsed = null;
- private ValueExpression _integerOnly = null;
- private ValueExpression _locale = null;
- private ValueExpression _maxFractionDigits = null;
- private ValueExpression _maxIntegerDigits = null;
- private ValueExpression _minFractionDigits = null;
- private ValueExpression _minIntegerDigits = null;
- private ValueExpression _pattern = null;
- private ValueExpression _type = null;
-
- public ConvertNumberTag()
- {
- setConverterIdString(NumberConverter.CONVERTER_ID);
- }
-
- public void setCurrencyCode(ValueExpression currencyCode)
- {
- _currencyCode = currencyCode;
- }
-
- public void setCurrencySymbol(ValueExpression currencySymbol)
- {
- _currencySymbol = currencySymbol;
- }
-
- public void setGroupingUsed(ValueExpression groupingUsed)
- {
- _groupingUsed = groupingUsed;
- }
-
- public void setIntegerOnly(ValueExpression integerOnly)
- {
- _integerOnly = integerOnly;
- }
-
- public void setLocale(ValueExpression locale)
- {
- _locale = locale;
- }
-
- public void setMaxFractionDigits(ValueExpression maxFractionDigits)
- {
- _maxFractionDigits = maxFractionDigits;
- }
-
- public void setMaxIntegerDigits(ValueExpression maxIntegerDigits)
- {
- _maxIntegerDigits = maxIntegerDigits;
- }
-
- public void setMinFractionDigits(ValueExpression minFractionDigits)
- {
- _minFractionDigits = minFractionDigits;
- }
-
- public void setMinIntegerDigits(ValueExpression minIntegerDigits)
- {
- _minIntegerDigits = minIntegerDigits;
- }
-
- public void setPattern(ValueExpression pattern)
- {
- _pattern = pattern;
- }
-
- public void setType(ValueExpression type)
- {
- _type = type;
- }
-
- @Override
- public void setPageContext(PageContext context)
- {
- super.setPageContext(context);
- setConverterIdString(NumberConverter.CONVERTER_ID);
- }
-
- @Override
- protected Converter createConverter() throws JspException
- {
- NumberConverter converter = (NumberConverter)super.createConverter();
- ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- if (null != _currencyCode)
- {
- converter.setCurrencyCode((String)UIComponentELTagUtils.evaluateValueExpression(elContext, _currencyCode));
- }
- if (null != _currencySymbol)
- {
- converter.setCurrencySymbol((String)UIComponentELTagUtils.evaluateValueExpression(elContext,
- _currencySymbol));
- }
- if (null != _groupingUsed)
- {
- converter.setGroupingUsed(UIComponentELTagUtils.getBooleanValue(elContext, _groupingUsed));
- }
- else
- {
- converter.setGroupingUsed(true);
- }
- if (null != _integerOnly)
- {
- converter.setIntegerOnly(UIComponentELTagUtils.getBooleanValue(elContext, _integerOnly));
- }
- else
- {
- converter.setIntegerOnly(false);
- }
- if (null != _locale)
- {
- Locale locale;
- if (_locale.isLiteralText())
- {
- locale = LocaleUtils.toLocale(_locale.getExpressionString());
- }
- else
- {
- Object localeValue = _locale.getValue(elContext);
- if (localeValue instanceof Locale)
- {
- locale = (Locale)localeValue;
- }
- else
- {
- locale = LocaleUtils.toLocale(localeValue.toString());
- }
- if (null == locale)
- {
- locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
- }
- }
- converter.setLocale(locale);
- }
- if (null != _maxFractionDigits)
- {
- converter.setMaxFractionDigits(UIComponentELTagUtils.getIntegerValue(elContext, _maxFractionDigits));
- }
- if (null != _maxIntegerDigits)
- {
- converter.setMaxIntegerDigits(UIComponentELTagUtils.getIntegerValue(elContext, _maxIntegerDigits));
- }
- if (null != _minFractionDigits)
- {
- converter.setMinFractionDigits(UIComponentELTagUtils.getIntegerValue(elContext, _minFractionDigits));
- }
- if (null != _minIntegerDigits)
- {
- converter.setMinIntegerDigits(UIComponentELTagUtils.getIntegerValue(elContext, _minIntegerDigits));
- }
- if (null != _pattern)
- {
- converter.setPattern((String)UIComponentELTagUtils.evaluateValueExpression(elContext, _pattern));
- }
- if (null != _type)
- {
- converter.setType((String)UIComponentELTagUtils.evaluateValueExpression(elContext, _type));
- }
- else
- {
- converter.setType("number");
- }
- return converter;
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ConverterImplTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ConverterImplTag.java
deleted file mode 100644
index 8c03c48..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ConverterImplTag.java
+++ /dev/null
@@ -1,161 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.convert.Converter;
-import jakarta.faces.webapp.ConverterELTag;
-import jakarta.servlet.jsp.JspException;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-
-/**
- * This tag creates an instance of the specified Converter, and associates it with the nearest parent UIComponent.
- *
- * @author Leonardo Uribe (latest modification by $Author$)
- * @version $Revision$ $Date$
- *
- */
-@JSFJspTag(name = "f:converter", bodyContent = "empty")
-public class ConverterImplTag extends ConverterELTag
-{
-
- private static final long serialVersionUID = -4506829108081L;
- private ValueExpression _converterId;
- private ValueExpression _binding;
- private String _converterIdString = null;
-
- public ConverterImplTag()
- {
- super();
- }
-
- /**
- * The converter's registered ID.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.String")
- public void setConverterId(ValueExpression converterId)
- {
- _converterId = converterId;
- }
-
- /**
- * A ValueExpression that evaluates to a Converter.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="jakarta.faces.convert.Converter")
- public void setBinding(ValueExpression binding)
- {
- _binding = binding;
- }
-
- /**
- * Use this method to specify the converterId programmatically.
- *
- * @param converterIdString
- */
- public void setConverterIdString(String converterIdString)
- {
- _converterIdString = converterIdString;
- }
-
- @Override
- public void release()
- {
- super.release();
- _converterId = null;
- _binding = null;
- _converterIdString = null;
- }
-
- @Override
- protected Converter createConverter() throws JspException
- {
- if (_converterId != null && _converterId.isLiteralText())
- {
- return this.createClassicConverter();
- }
- if (_converterIdString != null)
- {
- return this.createClassicConverter();
- }
-
- return new DelegateConverter(_converterId, _binding, _converterIdString);
- }
-
- protected Converter createClassicConverter() throws JspException
- {
- Converter converter = null;
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
-
- // try to create the converter from the binding expression first, and then from
- // the converterId
- if (_binding != null)
- {
- try
- {
- converter = (Converter)_binding.getValue(elContext);
-
- if (converter != null)
- {
- return converter;
- }
- }
- catch (Exception e)
- {
- throw new JspException("Exception creating converter using binding", e);
- }
- }
-
- if ((_converterId != null) || (_converterIdString != null))
- {
- try
- {
- if (null != _converterIdString)
- {
- converter = facesContext.getApplication().createConverter(_converterIdString);
- }
- else
- {
- String converterId = (String)_converterId.getValue(elContext);
- converter = facesContext.getApplication().createConverter(converterId);
- }
-
- // with binding no converter was created, set its value with the converter
- // created using the converterId
- if (converter != null && _binding != null)
- {
- _binding.setValue(elContext, converter);
- }
- }
- catch (Exception e)
- {
- throw new JspException("Exception creating converter with converterId: " + _converterId, e);
- }
- }
-
- return converter;
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ConverterTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ConverterTag.java
deleted file mode 100644
index ff431fc..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ConverterTag.java
+++ /dev/null
@@ -1,139 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.convert.Converter;
-import jakarta.faces.webapp.ConverterELTag;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * Implementation of ConverterELTag
- *
- * @author Bruno Aranda (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-public class ConverterTag extends ConverterELTag
-{
-
- private static final long serialVersionUID = -4506829108081L;
- private ValueExpression _converterId;
- private ValueExpression _binding;
- private String _converterIdString = null;
-
- public ConverterTag()
- {
- super();
- }
-
- public void setConverterId(ValueExpression converterId)
- {
- _converterId = converterId;
- }
-
- public void setBinding(ValueExpression binding)
- {
- _binding = binding;
- }
-
- /**
- * Use this method to specify the converterId programmatically.
- *
- * @param converterIdString
- */
- public void setConverterIdString(String converterIdString)
- {
- _converterIdString = converterIdString;
- }
-
- @Override
- public void release()
- {
- super.release();
- _converterId = null;
- _binding = null;
- _converterIdString = null;
- }
-
- @Override
- protected Converter createConverter() throws JspException
- {
- Converter converter = null;
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
-
- // try to create the converter from the binding expression first, and then from
- // the converterId
- if (_binding != null)
- {
- try
- {
- converter = (Converter)_binding.getValue(elContext);
-
- if (converter != null)
- {
- return converter;
- }
- }
- catch (Exception e)
- {
- throw new JspException("Exception creating converter using binding", e);
- }
- }
-
- if ((_converterId != null) || (_converterIdString != null))
- {
- try
- {
- if (null != _converterIdString)
- {
- converter = facesContext.getApplication().createConverter(_converterIdString);
- }
- else
- {
- String converterId = (String)_converterId.getValue(elContext);
- converter = facesContext.getApplication().createConverter(converterId);
- }
-
- // with binding no converter was created, set its value with the converter
- // created using the converterId
- if (converter != null && _binding != null)
- {
- _binding.setValue(elContext, converter);
- }
- }
- catch (Exception e)
- {
- throw new JspException("Exception creating converter with converterId: " + _converterId, e);
- }
- }
-
- if (converter == null)
- {
- throw new JspException("Could not create converter. Please specify a valid converterId" +
- " or a non-null binding.");
- }
-
- return converter;
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateActionListener.java b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateActionListener.java
deleted file mode 100644
index 76b3292..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateActionListener.java
+++ /dev/null
@@ -1,165 +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.taglib.core;
-
-import jakarta.el.ELException;
-import jakarta.el.ValueExpression;
-import jakarta.faces.FacesException;
-import jakarta.faces.component.StateHolder;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.event.AbortProcessingException;
-import jakarta.faces.event.ActionEvent;
-import jakarta.faces.event.ActionListener;
-
-import org.apache.myfaces.util.lang.ClassUtils;
-
-
-/**
- * This class is used in conjunction with ActionListenerTag.
- *
- * When a tag like this is in a jsp page:
- * <code>
- * <f:actionListener binding="#{mybean}"/>
- *
- * or
- *
- * <f:actionListener type="#{'anyid'}" binding="#{mybean}"/>
- * </code>
- *
- * The value of mybean could be already on the context, so this
- * converter avoid creating a new variable and use the previous one.
- *
- * @author Leonardo Uribe (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-public class DelegateActionListener implements ActionListener, StateHolder
-{
-
- private ValueExpression _type;
- private ValueExpression _binding;
-
- public DelegateActionListener()
- {
- }
-
- public DelegateActionListener(ValueExpression type, ValueExpression binding)
- {
- super();
- _type = type;
- _binding = binding;
- }
-
- @Override
- public boolean isTransient()
- {
- return false;
- }
-
- @Override
- public void restoreState(FacesContext facesContext, Object state)
- {
- Object[] values = (Object[]) state;
- _type = (ValueExpression) values[0];
- _binding = (ValueExpression) values[1];
- }
-
- @Override
- public Object saveState(FacesContext facesContext)
- {
- Object[] values = new Object[2];
- values[0] = _type;
- values[1] = _binding;
- return values;
- }
-
- @Override
- public void setTransient(boolean arg0)
- {
- // Do nothing
- }
-
- private ActionListener _getDelegate()
- {
- return _createActionListener();
- }
-
- private ActionListener _createActionListener()
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ActionListener listener = null;
- // type and/or binding must be specified
- try
- {
- if (null != _binding)
- {
- try
- {
- listener = (ActionListener) _binding.getValue(facesContext
- .getELContext());
- if (null != listener)
- {
- return listener;
- }
- }
- catch (ELException e)
- {
- throw new ELException("Exception while evaluating the binding attribute", e);
- }
- }
- if (null != _type)
- {
- String className;
- if (_type.isLiteralText())
- {
- className = _type.getExpressionString();
- }
- else
- {
- className = (String) _type.getValue(facesContext.getELContext());
- }
-
- listener = (ActionListener) ClassUtils.newInstance(className);
- if (null != _binding)
- {
- try
- {
- _binding.setValue(facesContext.getELContext(), listener);
- }
- catch (ELException e)
- {
- throw new ELException("Exception while evaluating the binding attribute ");
- }
- }
- return listener;
- }
- }
- catch (ClassCastException e)
- {
- throw new FacesException(e);
- }
- return listener;
- }
-
- @Override
- public void processAction(ActionEvent event) throws AbortProcessingException
- {
- _getDelegate().processAction(event);
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateConverter.java b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateConverter.java
deleted file mode 100644
index 8b1f1d6..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateConverter.java
+++ /dev/null
@@ -1,176 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.StateHolder;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.convert.Converter;
-import jakarta.faces.convert.ConverterException;
-
-/**
- * This class is used in conjunction with ConverterImplTag.
- *
- * When a tag like this is in a jsp page:
- * <code>
- * <f:converter binding="#{mybean}"/>
- *
- * or
- *
- * <f:converter converterId="#{'anyid'}" binding="#{mybean}"/>
- * </code>
- * The value of mybean could be already on the context, so this
- * converter avoid creating a new variable and use the previous one.
- *
- * @author Leonardo Uribe (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-public class DelegateConverter implements Converter, StateHolder
-{
-
- private ValueExpression _converterId;
- private ValueExpression _binding;
- private String _converterIdString = null;
-
- public DelegateConverter()
- {
-
- }
-
- public DelegateConverter(ValueExpression id, ValueExpression binding, String converterIdString)
- {
- super();
- _converterId = id;
- _binding = binding;
- _converterIdString = converterIdString;
- }
-
- @Override
- public boolean isTransient()
- {
- return false;
- }
-
- @Override
- public void restoreState(FacesContext facesContext, Object state)
- {
- Object[] values = (Object[]) state;
- _converterId = (ValueExpression) values[0];
- _binding = (ValueExpression) values[1];
- _converterIdString = (String) values[2];
- }
-
- @Override
- public Object saveState(FacesContext facesContext)
- {
- Object[] values = new Object[3];
- values[0] = _converterId;
- values[1] = _binding;
- values[2] = _converterIdString;
- return values;
- }
-
- @Override
- public void setTransient(boolean arg0)
- {
- // Do nothing
- }
-
- @Override
- public Object getAsObject(FacesContext facesContext, UIComponent component, String value)
- {
- return _getDelegate().getAsObject(facesContext, component, value);
- }
-
- @Override
- public String getAsString(FacesContext facesContext, UIComponent component, Object value)
- {
- return _getDelegate().getAsString(facesContext, component, value);
- }
-
- private Converter _getDelegate()
- {
- return _createConverter();
- }
-
- private Converter _createConverter()
- {
- Converter converter = null;
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
-
- // try to create the converter from the binding expression first, and then from
- // the converterId
- if (_binding != null)
- {
- try
- {
- converter = (Converter) _binding.getValue(elContext);
-
- if (converter != null)
- {
- return converter;
- }
- }
- catch (Exception e)
- {
- throw new ConverterException("Exception creating converter using binding", e);
- }
- }
-
- if ((_converterId != null) || (_converterIdString != null))
- {
- try
- {
- if (null != _converterIdString)
- {
- converter = facesContext.getApplication().createConverter(_converterIdString);
- }
- else
- {
- String converterId = (String) _converterId.getValue(elContext);
- converter = facesContext.getApplication().createConverter(converterId);
- }
-
- // with binding no converter was created, set its value with the converter
- // created using the converterId
- if (converter != null && _binding != null)
- {
- _binding.setValue(elContext, converter);
- }
- }
- catch (Exception e)
- {
- throw new ConverterException("Exception creating converter with converterId: " + _converterId, e);
- }
- }
-
- if (converter == null)
- {
- throw new IllegalStateException("Could not create converter. Please specify a valid converterId" +
- " or a non-null binding.");
- }
-
- return converter;
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValidator.java b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValidator.java
deleted file mode 100644
index 90a980c..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValidator.java
+++ /dev/null
@@ -1,165 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.application.Application;
-import jakarta.faces.application.FacesMessage;
-import jakarta.faces.component.StateHolder;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.validator.Validator;
-import jakarta.faces.validator.ValidatorException;
-
-/**
- * This class is used in conjunction with ValidatorImplTag.
- *
- * When a tag like this is in a jsp page:
- *
- * <code>
- * <f:validator binding="#{mybean}"/>
- *
- * or
- *
- * <f:validator validatorId="#{'anyid'}" binding="#{mybean}"/>
- * </code>
- *
- * The value of mybean could be already on the context, so this
- * converter avoid creating a new variable and use the previous one.
- *
- * @author Leonardo Uribe (latest modification by $Author$)
- * @version $Revision$ $Date$
- *
- */
-public class DelegateValidator implements Validator, StateHolder
-{
-
- private ValueExpression _validatorId;
- private ValueExpression _binding;
- private String _validatorIdString = null;
-
- public DelegateValidator()
- {
-
- }
-
- public DelegateValidator(ValueExpression id, ValueExpression binding, String converterIdString)
- {
- super();
- _validatorId = id;
- _binding = binding;
- _validatorIdString = converterIdString;
- }
-
- @Override
- public boolean isTransient()
- {
- return false;
- }
-
- @Override
- public void restoreState(FacesContext facesContext, Object state)
- {
- Object[] values = (Object[]) state;
- _validatorId = (ValueExpression) values[0];
- _binding = (ValueExpression) values[1];
- _validatorIdString = (String) values[2];
- }
-
- @Override
- public Object saveState(FacesContext facesContext)
- {
- Object[] values = new Object[3];
- values[0] = _validatorId;
- values[1] = _binding;
- values[2] = _validatorIdString;
- return values;
- }
-
- @Override
- public void setTransient(boolean arg0)
- {
- // Do nothing
- }
-
- private Validator _getDelegate()
- {
- return _createValidator();
- }
-
- private Validator _createValidator()
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
- if (null != _binding)
- {
- Object validator;
- try
- {
- validator = _binding.getValue(elContext);
- }
- catch (Exception e)
- {
- throw new ValidatorException(new FacesMessage("Error while creating the Validator"), e);
- }
- if (validator instanceof Validator)
- {
- return (Validator) validator;
- }
- }
- Application application = facesContext.getApplication();
- Validator validator = null;
- try
- {
- // first check if an ValidatorId was set by a method
- if (null != _validatorIdString)
- {
- validator = application.createValidator(_validatorIdString);
- }
- else if (null != _validatorId)
- {
- String validatorId = (String) _validatorId.getValue(elContext);
- validator = application.createValidator(validatorId);
- }
- }
- catch (Exception e)
- {
- throw new ValidatorException(new FacesMessage("Error while creating the Validator"), e);
- }
-
- if (null != validator)
- {
- if (null != _binding)
- {
- _binding.setValue(elContext, validator);
- }
- return validator;
- }
- throw new ValidatorException(new FacesMessage("validatorId and/or binding must be specified"));
- }
-
- @Override
- public void validate(FacesContext facesContext, UIComponent component, Object value)
- throws ValidatorException
- {
- _getDelegate().validate(facesContext, component, value);
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValueChangeListener.java b/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValueChangeListener.java
deleted file mode 100644
index 537d2b8..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/DelegateValueChangeListener.java
+++ /dev/null
@@ -1,166 +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.taglib.core;
-
-import jakarta.el.ELException;
-import jakarta.el.ValueExpression;
-import jakarta.faces.FacesException;
-import jakarta.faces.component.StateHolder;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.event.AbortProcessingException;
-import jakarta.faces.event.ValueChangeEvent;
-import jakarta.faces.event.ValueChangeListener;
-
-/**
- * This class is used in conjunction with ValueChangeListenerTag.
- *
- * When a tag like this is in a jsp page:
- *
- * <f:valueChangeListener binding="#{mybean}"/>
- *
- * or
- *
- * <f:valueChangeListener type="#{'anyid'}" binding="#{mybean}"/>
- *
- * The value of mybean could be already on the context, so this converter avoid creating a new variable and use the
- * previous one.
- *
- * @author Leonardo Uribe (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-public class DelegateValueChangeListener implements ValueChangeListener, StateHolder
-{
-
- private ValueExpression _type;
- private ValueExpression _binding;
-
- public DelegateValueChangeListener()
- {
- }
-
- public DelegateValueChangeListener(ValueExpression type, ValueExpression binding)
- {
- super();
- _type = type;
- _binding = binding;
- }
-
- @Override
- public boolean isTransient()
- {
- return false;
- }
-
- @Override
- public void restoreState(FacesContext facesContext, Object state)
- {
- Object[] values = (Object[]) state;
- _type = (ValueExpression) values[0];
- _binding = (ValueExpression) values[1];
- }
-
- @Override
- public Object saveState(FacesContext facesContext)
- {
- Object[] values = new Object[2];
- values[0] = _type;
- values[1] = _binding;
- return values;
- }
-
- @Override
- public void setTransient(boolean arg0)
- {
- // Do nothing
- }
-
- private ValueChangeListener _getDelegate()
- {
- return _createValueChangeListener();
- }
-
- private ValueChangeListener _createValueChangeListener()
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ValueChangeListener listener = null;
- // type and/or binding must be specified
- try
- {
- if (null != _binding)
- {
- try
- {
- listener = (ValueChangeListener)_binding.getValue(facesContext.getELContext());
- if (null != listener)
- {
- return listener;
- }
- }
- catch (ELException e)
- {
- // throw new JspException("Exception while evaluating the binding attribute of Component "
- // + component.getId(), e);
- }
- }
-
- if (null != _type)
- {
- // FIXME: The listener never get created, check when this class is really used.
- /*String className;
- if (_type.isLiteralText())
- {
- className = _type.getExpressionString();
- }
- else
- {
- className = (String) _type.getValue(facesContext.getELContext());
- }*/
-
- listener = null;
- // listener = (ActionListener) ClassUtils.newInstance(className);
- if (null != _binding)
- {
- try
- {
- _binding.setValue(facesContext.getELContext(), listener);
- }
- catch (ELException e)
- {
- // throw new JspException("Exception while evaluating the binding attribute of Component "
- // + component.getId(), e);
- }
- }
-
- return listener;
- }
- }
- catch (ClassCastException e)
- {
- throw new FacesException(e);
- }
-
- return listener;
- }
-
- @Override
- public void processValueChange(ValueChangeEvent event) throws AbortProcessingException
- {
- _getDelegate().processValueChange(event);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/GenericListenerTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/GenericListenerTag.java
deleted file mode 100644
index a25f794..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/GenericListenerTag.java
+++ /dev/null
@@ -1,186 +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.taglib.core;
-
-import jakarta.el.ELException;
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.webapp.UIComponentClassicTagBase;
-import jakarta.faces.webapp.UIComponentELTag;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-import org.apache.myfaces.util.lang.ClassUtils;
-
-/**
- * @author Andreas Berger (latest modification by $Author$)
- * @version $Revision$ $Date$
- * @since 1.2
- */
-public abstract class GenericListenerTag<_Holder, _Listener> extends TagSupport
-{
- private ValueExpression _type = null;
- private ValueExpression _binding = null;
- private Class<_Holder> _holderClazz;
-
- protected GenericListenerTag(Class<_Holder> holderClazz)
- {
- super();
- _holderClazz = holderClazz;
- }
-
- public void setType(ValueExpression type)
- {
- _type = type;
- }
-
- public void setBinding(ValueExpression binding)
- {
- _binding = binding;
- }
-
- @Override
- public void release()
- {
- super.release();
- _type = null;
- _binding = null;
- }
-
- protected abstract void addListener(_Holder holder, _Listener listener);
-
- protected abstract _Listener createDelegateListener(ValueExpression type, ValueExpression binding);
-
- @Override
- @SuppressWarnings("unchecked")
- public int doStartTag() throws JspException
- {
- UIComponentClassicTagBase componentTag = UIComponentELTag.getParentUIComponentClassicTagBase(pageContext);
- if (componentTag == null)
- {
- throw new JspException("no parent UIComponentTag found");
- }
-
- if (_type == null && _binding == null)
- {
- throw new JspException("\"actionListener\" must have binding and/or type attribute.");
- }
-
- if (!componentTag.getCreated())
- {
- return Tag.SKIP_BODY;
- }
-
- _Holder holder = null;
- UIComponent component = componentTag.getComponentInstance();
- try
- {
- holder = (_Holder)component;
- }
- catch (ClassCastException e)
- {
- throw new JspException("Component " + ((UIComponent)holder).getId() + " is not instance of "
- + _holderClazz.getName());
- }
-
- if (_type != null && _type.isLiteralText())
- {
- createListener(holder, component);
- }
- else
- {
- addListener(holder, createDelegateListener(_type, _binding));
- }
-
- return Tag.SKIP_BODY;
- }
-
- @SuppressWarnings("unchecked")
- protected void createListener(_Holder holder, UIComponent component) throws JspException
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- _Listener listener;
- // type and/or binding must be specified
- try
- {
- if (null != _binding)
- {
- try
- {
- listener = (_Listener)_binding.getValue(facesContext.getELContext());
- if (null != listener)
- {
- addListener(holder, listener);
- // no need for further processing
- return;
- }
- }
- catch (ELException e)
- {
- throw new JspException("Exception while evaluating the binding attribute of Component "
- + component.getId(), e);
- }
- }
- if (null != _type)
- {
- String className;
- if (_type.isLiteralText())
- {
- className = _type.getExpressionString();
- // If type is literal text we should create
- // a new instance
- listener = (_Listener)ClassUtils.newInstance(className);
- }
- else
- {
- className = (String)_type.getValue(facesContext.getELContext());
- listener = null;
- }
-
- if (null != _binding)
- {
- try
- {
- _binding.setValue(facesContext.getELContext(), listener);
- }
- catch (ELException e)
- {
- throw new JspException("Exception while evaluating the binding attribute of Component "
- + component.getId(), e);
- }
- }
- else
- {
- // Type is a EL expression, and there is
- // no binding property so we should create
- // a new instance
- listener = (_Listener)ClassUtils.newInstance(className);
- }
- addListener(holder, listener);
- }
- }
- catch (ClassCastException e)
- {
- throw new JspException(e);
- }
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/GenericMinMaxValidatorTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/GenericMinMaxValidatorTag.java
deleted file mode 100644
index 2ecd690..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/GenericMinMaxValidatorTag.java
+++ /dev/null
@@ -1,104 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.validator.Validator;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * This is the base Tag for all ValidatorTags which got a minimum and a maimum attribute.
- *
- * @author Andreas Berger (latest modification by $Author$)
- * @version $Revision$ $Date$
- * @since 1.2
- */
-public abstract class GenericMinMaxValidatorTag<T> extends ValidatorTag
-{
- protected ValueExpression _minimum;
- protected ValueExpression _maximum;
- protected T _min = null;
- protected T _max = null;
-
- public void setMinimum(ValueExpression minimum)
- {
- _minimum = minimum;
- }
-
- public void setMaximum(ValueExpression maximum)
- {
- _maximum = maximum;
- }
-
- @Override
- public void release()
- {
- _minimum = null;
- _maximum = null;
- _min = null;
- _max = null;
- }
-
- /**
- * This method returns the Validator, you have to cast it to the correct type and apply the min and max values.
- *
- * @return
- * @throws JspException
- */
- @Override
- protected Validator createValidator() throws JspException
- {
- if (null == _minimum && null == _maximum)
- {
- throw new JspException("a minimum and / or a maximum have to be specified");
- }
- ELContext elContext = FacesContext.getCurrentInstance().getELContext();
- if (null != _minimum)
- {
- _min = getValue(_minimum.getValue(elContext));
- }
- if (null != _maximum)
- {
- _max = getValue(_maximum.getValue(elContext));
- }
- if (null != _minimum && null != _maximum)
- {
- if (!isMinLTMax())
- {
- throw new JspException("maximum limit must be greater than the minimum limit");
- }
- }
- return super.createValidator();
- }
-
- /**
- * @return true if min is lower than max
- */
- protected abstract boolean isMinLTMax();
-
- /**
- * Wrapper method.
- *
- * @param value
- * @return
- */
- protected abstract T getValue(Object value);
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/LoadBundleTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/LoadBundleTag.java
deleted file mode 100755
index b894ccb..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/LoadBundleTag.java
+++ /dev/null
@@ -1,304 +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.taglib.core;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import java.util.Set;
-
-import jakarta.faces.component.UIViewRoot;
-import jakarta.faces.context.FacesContext;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-import jakarta.el.ValueExpression;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-import org.apache.myfaces.config.MyfacesConfig;
-import org.apache.myfaces.util.lang.ClassUtils;
-
-/**
- * Loads a resource bundle and saves it as a variable in the request scope.
- * <p>
- * Unless otherwise specified, all attributes accept static values or EL expressions.
- * </p>
- * <p>
- * TODO: We should find a way to save loaded bundles in the state, because otherwise on the next request the bundle map
- * will not be present before the render phase and value bindings that reference to the bundle will always log annoying
- * "Variable 'xxx' could not be resolved" error messages.
- * </p>
- *
- * @author Manfred Geiler (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-@JSFJspTag(name = "f:loadBundle", bodyContent = "empty")
-public class LoadBundleTag extends TagSupport
-{
- private static final long serialVersionUID = -8892145684062838928L;
-
- private ValueExpression _basename;
- private String _var;
-
- /**
- * The base name of the resource bundle.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.String")
- public void setBasename(ValueExpression basename)
- {
- _basename = basename;
- }
-
- /**
- * The name of the variable in request scope that the resources are saved to. This must be a static value.
- */
- @JSFJspAttribute(required = true)
- public void setVar(String var)
- {
- _var = var;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
- if (null == _var)
- {
- throw new NullPointerException("LoadBundle: 'var' must not be null");
- }
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- if (facesContext == null)
- {
- throw new JspException("No faces context?!");
- }
-
- UIViewRoot viewRoot = facesContext.getViewRoot();
- if (viewRoot == null)
- {
- throw new JspException("No view root! LoadBundle must be nested inside <f:view> action.");
- }
-
- Locale locale = viewRoot.getLocale();
- if (locale == null)
- {
- locale = facesContext.getApplication().getDefaultLocale();
- }
-
- String basename = null;
- if (_basename != null)
- {
- if (_basename.isLiteralText())
- {
- basename = _basename.getExpressionString();
- }
- else
- {
- basename = (String)_basename.getValue(facesContext.getELContext());
- }
- }
-
- if (null == basename)
- {
- throw new NullPointerException("LoadBundle: 'basename' must not be null");
- }
-
- ResourceBundle.Control bundleControl =
- MyfacesConfig.getCurrentInstance(facesContext).getResourceBundleControl();
- ResourceBundle bundle;
- try
- {
- if (bundleControl == null)
- {
- bundle = ResourceBundle.getBundle(basename, locale, ClassUtils.getContextClassLoader());
- }
- else
- {
- bundle = ResourceBundle.getBundle(basename, locale, ClassUtils.getContextClassLoader(),
- bundleControl);
- }
- }
- catch (MissingResourceException e)
- {
- try
- {
- if (bundleControl == null)
- {
- bundle = ResourceBundle.getBundle(basename, locale, this.getClass().getClassLoader());
- }
- else
- {
- bundle = ResourceBundle.getBundle(basename, locale, this.getClass().getClassLoader(),
- bundleControl);
- }
- }
- catch (MissingResourceException e1)
- {
- throw new JspException("Resource bundle '" + basename + "' could not be found.", e1);
- }
- }
-
- facesContext.getExternalContext().getRequestMap().put(_var, new BundleMap(bundle));
- return Tag.SKIP_BODY;
- }
-
- private static class BundleMap implements Map<String, String>
- {
- private ResourceBundle _bundle;
- private List<String> _values;
-
- public BundleMap(ResourceBundle bundle)
- {
- _bundle = bundle;
- }
-
- // Optimized methods
-
- @Override
- public String get(Object key)
- {
- try
- {
- return (String)_bundle.getObject(key.toString());
- }
- catch (Exception e)
- {
- return "???" + key + "???";
- }
- }
-
- @Override
- public boolean isEmpty()
- {
- return !_bundle.getKeys().hasMoreElements();
- }
-
- @Override
- public boolean containsKey(Object key)
- {
- return _bundle.containsKey(key.toString());
- }
-
- // Unoptimized methods
-
- @Override
- public Collection<String> values()
- {
- if (_values == null)
- {
- _values = new ArrayList<>();
- for (Enumeration<String> enumer = _bundle.getKeys(); enumer.hasMoreElements();)
- {
- String v = _bundle.getString(enumer.nextElement());
- _values.add(v);
- }
- }
- return _values;
- }
-
- @Override
- public int size()
- {
- return values().size();
- }
-
- @Override
- public boolean containsValue(Object value)
- {
- return values().contains(value);
- }
-
- @Override
- public Set<Map.Entry<String, String>> entrySet()
- {
- Set<Entry<String, String>> set = new HashSet<>();
- for (Enumeration<String> enumer = _bundle.getKeys(); enumer.hasMoreElements();)
- {
- final String k = enumer.nextElement();
- set.add(new Map.Entry<String, String>()
- {
- @Override
- public String getKey()
- {
- return k;
- }
-
- @Override
- public String getValue()
- {
- return (String)_bundle.getObject(k);
- }
-
- @Override
- public String setValue(String value)
- {
- throw new UnsupportedOperationException(this.getClass().getName()
- + " UnsupportedOperationException");
- }
- });
- }
- return set;
- }
-
- @Override
- public Set<String> keySet()
- {
- Set<String> set = new HashSet<>();
- for (Enumeration<String> enumer = _bundle.getKeys(); enumer.hasMoreElements();)
- {
- set.add(enumer.nextElement());
- }
- return set;
- }
-
- // Unsupported methods
-
- @Override
- public String remove(Object key)
- {
- throw new UnsupportedOperationException(this.getClass().getName() + " UnsupportedOperationException");
- }
-
- @Override
- public void putAll(Map<? extends String, ? extends String> t)
- {
- throw new UnsupportedOperationException(this.getClass().getName() + " UnsupportedOperationException");
- }
-
- @Override
- public String put(String key, String value)
- {
- throw new UnsupportedOperationException(this.getClass().getName() + " UnsupportedOperationException");
- }
-
- @Override
- public void clear()
- {
- throw new UnsupportedOperationException(this.getClass().getName() + " UnsupportedOperationException");
- }
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ParamTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ParamTag.java
deleted file mode 100755
index 9b0bfad..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ParamTag.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.taglib.core;
-
-
-import jakarta.faces.component.UIComponent;
-import jakarta.el.ValueExpression;
-
-/**
- * DOCUMENT ME!
- *
- * @author Manfred Geiler (latest modification by $Author$)
- * @author Bruno Aranda (JSR-252)
- * @version $Revision$ $Date$
- */
-public class ParamTag extends UIComponentELTagBase
-{
- @Override
- public String getComponentType()
- {
- return "jakarta.faces.Parameter";
- }
-
- @Override
- public String getRendererType()
- {
- return null;
- }
-
- // UIComponent attributes --> already implemented in UIComponentELTagBase
-
- // UIParameter attributes
- private ValueExpression _name;
-
- @Override
- protected void setProperties(UIComponent component)
- {
- super.setProperties(component);
-
- setStringProperty(component, "name", _name);
- }
-
- public void setName(ValueExpression name)
- {
- _name = name;
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/PhaseListenerTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/PhaseListenerTag.java
deleted file mode 100644
index a46467b..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/PhaseListenerTag.java
+++ /dev/null
@@ -1,233 +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.taglib.core;
-
-import java.io.Serializable;
-import java.util.logging.Logger;
-
-import jakarta.el.ValueExpression;
-import jakarta.faces.FacesException;
-import jakarta.faces.component.UIViewRoot;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.event.AbortProcessingException;
-import jakarta.faces.event.PhaseEvent;
-import jakarta.faces.event.PhaseId;
-import jakarta.faces.event.PhaseListener;
-import jakarta.faces.webapp.UIComponentELTag;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.Tag;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-import org.apache.myfaces.util.lang.ClassUtils;
-
-/**
- * Register a PhaseListener instance
- *
- * @author martin.haimberger
- * @version $Revision$ $Date$
- */
-@JSFJspTag(name = "f:phaseListener", bodyContent = "empty")
-public class PhaseListenerTag extends TagSupport
-{
-
- private static final Logger log = Logger.getLogger(PhaseListenerTag.class.getName());
-
- /**
- * The fully qualified class name of the PhaseListener which should be created.
- */
- private ValueExpression type = null;
-
- /**
- * A value binding expression used to create a PhaseListener instance.
- */
- private ValueExpression binding = null;
-
- /**
- * Class name of the PhaseListener to be created and registered.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.String")
- public void setType(ValueExpression type)
- {
- this.type = type;
- }
-
- /**
- * Value binding expression that evaluates to a PhaseListener.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="jakarta.faces.event.PhaseListener")
- public void setBinding(ValueExpression binding)
- {
- this.binding = binding;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
-
- // JSF-Spec 1.2 9.4.9
- // Locate the one and only UIViewRoot custom action instance by walking up the tag tree
- // until you find a UIComponentELTag instance that has no parent. If the
- // getCreated() method of this instance returns true, check the binding attribute.
-
- Tag parent = this;
- UIComponentELTag parentTag = null;
- while ((parent = parent.getParent()) != null)
- {
- if (parent instanceof UIComponentELTag)
- {
- parentTag = (UIComponentELTag)parent;
- }
- }
-
- if (parentTag == null)
- {
- throw new JspException("Not nested in a UIViewRoot Error for tag with handler class: "
- + this.getClass().getName());
- }
-
- if (!parentTag.getCreated())
- {
- return SKIP_BODY;
- }
-
- UIViewRoot root = (UIViewRoot)parentTag.getComponentInstance();
-
- // JSF-Spec 1.2 9.4.9
- // If binding is set, call binding.getValue() to obtain a reference to the
- // PhaseListener instance. If there is no exception thrown, and binding.getValue()
- // returned a non-null object that implements jakarta.faces.event.PhaseListener, register
- // it by calling addPhaseListener(). If there was an exception thrown, rethrow the
- // exception as a JspException.
-
- // If the listener instance could not be created, check the type attribute. If the type
- // attribute is set, instantiate an instance of the specified class, and register it by calling
- // addPhaseListener(). If the binding attribute was also set, store the listener instance
- // by calling binding.setValue(). If there was an exception thrown, rethrow the
- // exception as a JspException.
-
- PhaseListener listener = null;
- try
- {
- listener = new BindingPhaseListener(binding, type);
- }
- catch (Exception ex)
- {
- throw new JspException(ex.getMessage(), ex);
- }
-
- root.addPhaseListener(listener);
-
- return SKIP_BODY;
-
- }
-
- private static class BindingPhaseListener implements PhaseListener, Serializable
- {
-
- private transient PhaseListener phaseListenerCache = null;
- private ValueExpression type;
- private ValueExpression binding;
-
- BindingPhaseListener(ValueExpression binding, ValueExpression type)
- {
- this.binding = binding;
- this.type = type;
- }
-
- public void afterPhase(PhaseEvent event)
- {
- PhaseListener listener = getPhaseListener();
- if (listener != null)
- {
- listener.afterPhase(event);
- }
- }
-
- public void beforePhase(PhaseEvent event)
- {
- PhaseListener listener = getPhaseListener();
- if (listener != null)
- {
- listener.beforePhase(event);
- }
- }
-
- public PhaseId getPhaseId()
- {
- PhaseListener listener = getPhaseListener();
- if (listener != null)
- {
- return listener.getPhaseId();
- }
-
- return null;
-
- }
-
- private PhaseListener getPhaseListener()
- {
-
- if (phaseListenerCache != null)
- {
- return phaseListenerCache;
- }
- else
- {
- // create PhaseListenerInstance
- phaseListenerCache = getPhaseListnerInstance(binding, type);
- }
- if (phaseListenerCache == null)
- {
- log.warning("PhaseListener will not be installed. Both binding and type are null.");
-
- }
-
- return phaseListenerCache;
-
- }
-
- private PhaseListener getPhaseListnerInstance(ValueExpression binding, ValueExpression type)
- {
- FacesContext currentFacesContext = FacesContext.getCurrentInstance();
- Object phasesInstance = null;
- if (binding != null)
- {
- phasesInstance = binding.getValue(currentFacesContext.getELContext());
- }
- else if (type != null)
- {
- try
- {
- phasesInstance = ClassUtils.newInstance((String)type.getValue(currentFacesContext.getELContext()));
- }
- catch (FacesException ex)
- {
- throw new AbortProcessingException(ex.getMessage(), ex);
- }
- }
- return (PhaseListener)phasesInstance;
-
- }
-
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/SelectItemTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/SelectItemTag.java
deleted file mode 100644
index 53288e1..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/SelectItemTag.java
+++ /dev/null
@@ -1,98 +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.taglib.core;
-
-import org.apache.myfaces.renderkit.html.util.JSFAttr;
-
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.UIComponent;
-
-public class SelectItemTag
- extends org.apache.myfaces.taglib.core.UIComponentELTagBase
-{
-
- @Override
- public String getComponentType()
- {
- return "jakarta.faces.SelectItem";
- }
-
- @Override
- public String getRendererType()
- {
- return null;
- }
-
- // UISelectItem attributes
- private ValueExpression _itemDisabled;
- private ValueExpression _itemDescription;
- private ValueExpression _itemLabel;
- private ValueExpression _itemValue;
- private ValueExpression _escape;
- private ValueExpression _noSelectionOption;
-
- @Override
- protected void setProperties(UIComponent component)
- {
- super.setProperties(component);
-
- setBooleanProperty(component, JSFAttr.ITEM_DISABLED_ATTR, _itemDisabled);
- setStringProperty(component, JSFAttr.ITEM_DESCRIPTION_ATTR, _itemDescription);
- setStringProperty(component, JSFAttr.ITEM_LABEL_ATTR, _itemLabel);
- setStringProperty(component, JSFAttr.ITEM_VALUE_ATTR, _itemValue);
- setBooleanProperty(component, JSFAttr.ITEM_ESCAPED_ATTR, _escape, Boolean.TRUE);
- setBooleanProperty(component, JSFAttr.NO_SELECTION_OPTION_ATTR, _noSelectionOption, Boolean.FALSE);
- }
-
- public void setItemDisabled(ValueExpression itemDisabled)
- {
- _itemDisabled = itemDisabled;
- }
-
- public void setItemDescription(ValueExpression itemDescription)
- {
- _itemDescription = itemDescription;
- }
-
- public void setItemLabel(ValueExpression itemLabel)
- {
- _itemLabel = itemLabel;
- }
-
- public void setItemValue(ValueExpression itemValue)
- {
- _itemValue = itemValue;
- }
-
- public void setEscape(ValueExpression escape)
- {
- _escape = escape;
- }
-
- protected ValueExpression getItemValue()
- {
- return _itemValue;
- }
-
- public void setNoSelectionOption(ValueExpression noSelectionOption)
- {
- _noSelectionOption = noSelectionOption;
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/SetPropertyActionListenerTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/SetPropertyActionListenerTag.java
deleted file mode 100644
index 626f8c7..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/SetPropertyActionListenerTag.java
+++ /dev/null
@@ -1,140 +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.taglib.core;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.ActionSource;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.event.ActionListener;
-import jakarta.faces.webapp.UIComponentClassicTagBase;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.TagSupport;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-import org.apache.myfaces.event.SetPropertyActionListener;
-
-/**
- * @author Dennis Byrne
- * @since 1.2
- */
-@JSFJspTag(name = "f:setPropertyActionListener", bodyContent = "empty")
-public class SetPropertyActionListenerTag extends TagSupport
-{
- private static final Logger log = Logger.getLogger(SetPropertyActionListenerTag.class.getName());
-
- private ValueExpression target;
-
- private ValueExpression value;
-
- @Override
- public int doStartTag() throws JspException
- {
-
- if (log.isLoggable(Level.FINE))
- {
- log.fine("JSF 1.2 Spec : Create a new instance of the ActionListener");
- }
-
- ActionListener actionListener = new SetPropertyActionListener(target, value);
-
- UIComponentClassicTagBase tag = UIComponentClassicTagBase.getParentUIComponentClassicTagBase(pageContext);
-
- if (tag == null)
- {
- throw new JspException("Could not find a " + "parent UIComponentClassicTagBase ... is this "
- + "tag in a child of a UIComponentClassicTagBase?");
- }
-
- if (tag.getCreated())
- {
-
- UIComponent component = tag.getComponentInstance();
-
- if (component == null)
- {
- throw new JspException(" Could not locate a UIComponent " + "for a UIComponentClassicTagBase w/ a "
- + "JSP id of " + tag.getJspId());
- }
-
- if (!(component instanceof ActionSource))
- {
- throw new JspException("Component w/ id of " + component.getId()
- + " is associated w/ a tag w/ JSP id of " + tag.getJspId() + ". This component is of type "
- + component.getClass() + ", which is not an " + ActionSource.class);
- }
-
- if (log.isLoggable(Level.FINE))
- {
- log.fine(" ... register it with the UIComponent " + "instance associated with our most immediately "
- + "surrounding UIComponentTagBase");
- }
-
- ((ActionSource)component).addActionListener(actionListener);
-
- }
-
- return SKIP_BODY;
- }
-
- /**
- * ValueExpression for the destination of the value attribute.
- */
- @JSFJspAttribute(required = true,
- className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.Object")
- public ValueExpression getTarget()
- {
- return target;
- }
-
- public void setTarget(ValueExpression target)
- {
- this.target = target;
- }
-
- /**
- * ValueExpression for the value of the target attribute.
- *
- * @return
- */
- @JSFJspAttribute(required = true,
- className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.Object")
- public ValueExpression getValue()
- {
- return value;
- }
-
- public void setValue(ValueExpression value)
- {
- this.value = value;
- }
-
- @Override
- public void release()
- {
- target = null;
- value = null;
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/SubviewTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/SubviewTag.java
deleted file mode 100755
index 4cd720e..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/SubviewTag.java
+++ /dev/null
@@ -1,96 +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.taglib.core;
-
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.component.UINamingContainer;
-import jakarta.faces.component.UIOutput;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.webapp.UIComponentELTag;
-
-import org.apache.myfaces.view.ServletViewResponseWrapper;
-
-/**
- * @author Thomas Spiegl (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-public class SubviewTag extends UIComponentELTag
-{
- public SubviewTag()
- {
- super();
- }
-
- @Override
- public String getComponentType()
- {
- return UINamingContainer.COMPONENT_TYPE;
- }
-
- @Override
- public String getRendererType()
- {
- return null;
- }
-
- /**
- * Creates a UIComponent from the BodyContent If a Subview is included via the <jsp:include> tag
- * the corresponding jsp is rendered with
- * getServletContext().getRequestDispatcher("includedSite").include(request,response) and it is
- * possible that something was written to the Response direct. So is is necessary that the content of the wrapped
- * response is added to the componenttree.
- *
- * @return UIComponent or null
- */
- @Override
- protected UIComponent createVerbatimComponentFromBodyContent()
- {
- UIOutput component = (UIOutput)super.createVerbatimComponentFromBodyContent();
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Object response = facesContext.getExternalContext().getResponse();
- String wrappedOutput;
-
- if (response instanceof ServletViewResponseWrapper)
- {
- ServletViewResponseWrapper wrappedResponse = (ServletViewResponseWrapper)response;
- wrappedOutput = wrappedResponse.toString();
- if (wrappedOutput != null && wrappedOutput.length() > 0)
- {
- String componentvalue = null;
- if (component != null)
- {
- // save the Value of the Bodycontent
- componentvalue = (String)component.getValue();
- }
- component = super.createVerbatimComponent();
- if (componentvalue != null)
- {
- component.setValue(wrappedOutput + componentvalue);
- }
- else
- {
- component.setValue(wrappedOutput);
- }
- wrappedResponse.reset();
- }
- }
- return component;
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/UIComponentELTagBase.java b/impl/src/main/java/org/apache/myfaces/taglib/core/UIComponentELTagBase.java
deleted file mode 100644
index 808a285..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/UIComponentELTagBase.java
+++ /dev/null
@@ -1,215 +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.taglib.core;
-
-import org.apache.myfaces.renderkit.html.util.JSFAttr;
-
-import jakarta.el.MethodExpression;
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.webapp.UIComponentELTag;
-
-public abstract class UIComponentELTagBase extends UIComponentELTag
-{
- //UIComponent attributes
- private ValueExpression _forceId;
-
- private ValueExpression _forceIdIndex;
- private static final Boolean DEFAULT_FORCE_ID_INDEX_VALUE = Boolean.TRUE;
-
-
- //Special UIComponent attributes (ValueHolder, ConvertibleValueHolder)
- private ValueExpression _value;
- private ValueExpression _converter;
-
- //attributes id, rendered and binding are handled by UIComponentTag
-
- @Override
- public void release()
- {
- super.release();
-
- _forceId = null;
- _forceIdIndex = null;
-
- _value = null;
- _converter = null;
- }
-
- @Override
- protected void setProperties(UIComponent component)
- {
- super.setProperties(component);
-
- setBooleanProperty(component,
- JSFAttr.FORCE_ID_ATTR,
- _forceId);
- setBooleanProperty(
- component,
- JSFAttr.FORCE_ID_INDEX_ATTR,
- _forceIdIndex, DEFAULT_FORCE_ID_INDEX_VALUE);
-
- //rendererType already handled by UIComponentTag
-
- setValueProperty(component, _value);
- setConverterProperty(component, _converter);
- }
-
- /**
- * Sets the forceId attribute of the tag. NOTE: Not every tag that extends this class will
- * actually make use of this attribute. Check the TLD to see which components actually
- * implement it.
- *
- * @param aForceId The value of the forceId attribute.
- */
- public void setForceId(ValueExpression aForceId)
- {
- _forceId = aForceId;
- }
-
- /**
- * Sets the forceIdIndex attribute of the tag. NOTE: Not every tag that extends this class will
- * actually make use of this attribute. Check the TLD to see which components actually implement it.
- *
- * @param aForceIdIndex The value of the forceIdIndex attribute.
- */
- public void setForceIdIndex(ValueExpression aForceIdIndex)
- {
- _forceIdIndex = aForceIdIndex;
- }
-
- public void setValue(ValueExpression value)
- {
- _value = value;
- }
-
- public void setConverter(ValueExpression converter)
- {
- _converter = converter;
- }
-
- // sub class helpers
-
- protected void setIntegerProperty(UIComponent component, String propName,
- ValueExpression value)
- {
- UIComponentELTagUtils.setIntegerProperty(component, propName, value);
- }
-
- protected void setIntegerProperty(UIComponent component, String propName,
- ValueExpression value, Integer defaultValue)
- {
- UIComponentELTagUtils.setIntegerProperty(component, propName, value,
- defaultValue);
- }
-
- protected void setLongProperty(UIComponent component, String propName,
- ValueExpression value)
- {
- UIComponentELTagUtils.setLongProperty(component, propName, value);
- }
-
- protected void setLongProperty(UIComponent component, String propName,
- ValueExpression value, Long defaultValue)
- {
- UIComponentELTagUtils.setLongProperty(component, propName, value,
- defaultValue);
- }
-
- protected void setStringProperty(UIComponent component, String propName,
- ValueExpression value)
- {
- UIComponentELTagUtils.setStringProperty(component, propName, value);
- }
-
- protected void setStringProperty(UIComponent component, String propName,
- ValueExpression value, String defaultValue)
- {
- UIComponentELTagUtils.setStringProperty(component, propName, value,
- defaultValue);
- }
-
- protected void setBooleanProperty(UIComponent component, String propName,
- ValueExpression value)
- {
- UIComponentELTagUtils.setBooleanProperty(component, propName, value);
- }
-
- protected void setBooleanProperty(UIComponent component, String propName,
- ValueExpression value, Boolean defaultValue)
- {
- UIComponentELTagUtils.setBooleanProperty(component, propName, value,
- defaultValue);
- }
-
- private void setValueProperty(UIComponent component, ValueExpression value)
- {
- UIComponentELTagUtils.setValueProperty(getFacesContext(), component,
- value);
- }
-
- private void setConverterProperty(UIComponent component,
- ValueExpression value)
- {
- UIComponentELTagUtils.setConverterProperty(getFacesContext(),
- component, value);
- }
-
- protected void addValidatorProperty(UIComponent component,
- MethodExpression value)
- {
- UIComponentELTagUtils.addValidatorProperty(getFacesContext(),
- component, value);
- }
-
- protected void setActionProperty(UIComponent component,
- MethodExpression action)
- {
- UIComponentELTagUtils.setActionProperty(getFacesContext(), component,
- action);
- }
-
- protected void setActionListenerProperty(UIComponent component,
- MethodExpression actionListener)
- {
- UIComponentELTagUtils.addActionListenerProperty(getFacesContext(),
- component, actionListener);
- }
-
- protected void addValueChangedListenerProperty(UIComponent component,
- MethodExpression valueChangedListener)
- {
- UIComponentELTagUtils.addValueChangedListenerProperty(
- getFacesContext(), component, valueChangedListener);
- }
-
- protected void setValueBinding(UIComponent component, String propName,
- ValueExpression value)
- {
- UIComponentELTagUtils.setValueBinding(getFacesContext(), component,
- propName, value);
- }
-
- protected Object evaluateValueExpression(ValueExpression expression)
- {
- return UIComponentELTagUtils.evaluateValueExpression(getFacesContext()
- .getELContext(), expression);
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/UIComponentELTagUtils.java b/impl/src/main/java/org/apache/myfaces/taglib/core/UIComponentELTagUtils.java
deleted file mode 100644
index 53739f8..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/UIComponentELTagUtils.java
+++ /dev/null
@@ -1,410 +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.taglib.core;
-
-import java.util.logging.Logger;
-
-import jakarta.el.ELContext;
-import jakarta.el.MethodExpression;
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.ActionSource2;
-import jakarta.faces.component.EditableValueHolder;
-import jakarta.faces.component.UICommand;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.component.UIGraphic;
-import jakarta.faces.component.UIParameter;
-import jakarta.faces.component.UISelectBoolean;
-import jakarta.faces.component.ValueHolder;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.convert.Converter;
-import jakarta.faces.event.MethodExpressionActionListener;
-import jakarta.faces.event.MethodExpressionValueChangeListener;
-import jakarta.faces.validator.MethodExpressionValidator;
-import org.apache.myfaces.renderkit.html.util.JSFAttr;
-
-/**
- * @since 1.2
- */
-public class UIComponentELTagUtils
-{
-
- private static final Logger log = Logger
- .getLogger(UIComponentELTagUtils.class.getName());
-
- private UIComponentELTagUtils()
- {
- } //util class, no instantiation allowed
-
- /**
- * @since 1.2
- */
- public static void setIntegerProperty(UIComponent component,
- String propName, ValueExpression value)
- {
- setIntegerProperty(component, propName, value, null);
- }
-
- /**
- * @since 1.2
- */
- public static void setIntegerProperty(UIComponent component,
- String propName, ValueExpression value, Integer defaultValue)
- {
- if (value != null)
- {
- if (value.isLiteralText())
- {
- component.getAttributes().put(propName,
- Integer.valueOf(value.getExpressionString()));
- }
- else
- {
- component.setValueExpression(propName, value);
- }
- }
- else
- {
- if (defaultValue != null)
- {
- component.getAttributes().put(propName, defaultValue);
- }
- }
- }
-
- /**
- * @since 1.2
- */
- public static void setLongProperty(UIComponent component, String propName,
- ValueExpression value)
- {
- setLongProperty(component, propName, value, null);
- }
-
- /**
- * @since 1.2
- */
- public static void setLongProperty(UIComponent component, String propName,
- ValueExpression value, Long defaultValue)
- {
- if (value != null)
- {
- if (value.isLiteralText())
- {
- component.getAttributes().put(propName,
- Long.valueOf(value.getExpressionString()));
- }
- else
- {
- component.setValueExpression(propName, value);
- }
- }
- else
- {
- if (defaultValue != null)
- {
- component.getAttributes().put(propName, defaultValue);
- }
- }
- }
-
- /**
- * @since 1.2
- */
- public static void setStringProperty(UIComponent component,
- String propName, ValueExpression value)
- {
- setStringProperty(component, propName, value, null);
- }
-
- /**
- * @since 1.2
- */
- public static void setStringProperty(UIComponent component,
- String propName, ValueExpression value, String defaultValue)
- {
- if (value != null)
- {
- if (value.isLiteralText())
- {
- component.getAttributes().put(propName,
- value.getExpressionString());
- }
- else
- {
- component.setValueExpression(propName, value);
- }
- }
- else
- {
- if (defaultValue != null)
- {
- component.getAttributes().put(propName, defaultValue);
- }
- }
- }
-
- /**
- * @since 1.2
- */
- public static void setBooleanProperty(UIComponent component,
- String propName, ValueExpression value)
- {
- setBooleanProperty(component, propName, value, null);
- }
-
- /**
- * @since 1.2
- */
- public static void setBooleanProperty(UIComponent component,
- String propName, ValueExpression value, Boolean defaultValue)
- {
- if (value != null)
- {
- if (value.isLiteralText())
- {
- component.getAttributes().put(propName,
- Boolean.valueOf(value.getExpressionString()));
- }
- else
- {
- component.setValueExpression(propName, value);
- }
- }
- else
- {
- if (defaultValue != null)
- {
- component.getAttributes().put(propName, defaultValue);
- }
- }
- }
-
- /**
- * @since 1.2
- */
- public static void setValueProperty(FacesContext context,
- UIComponent component, ValueExpression value)
- {
- if (value != null)
- {
- if (!value.isLiteralText())
- {
- component.setValueExpression(
- JSFAttr.VALUE_ATTR,
- value);
- }
- else if (component instanceof UICommand)
- {
- ((UICommand) component).setValue(value.getExpressionString());
- }
- else if (component instanceof UIParameter)
- {
- ((UIParameter) component).setValue(value.getExpressionString());
- }
- else if (component instanceof UISelectBoolean)
- {
- ((UISelectBoolean) component).setValue(Boolean.valueOf(value
- .getExpressionString()));
- }
- else if (component instanceof UIGraphic)
- {
- ((UIGraphic) component).setValue(value.getExpressionString());
- }
- //Since many input components are ValueHolders the special components
- //must come first, ValueHolder is the last resort.
- else if (component instanceof ValueHolder)
- {
- ((ValueHolder) component).setValue(value.getExpressionString());
- }
- else
- {
- log.severe("Component " + component.getClass().getName()
- + " is no ValueHolder, cannot set value.");
- }
- }
- }
-
- /**
- * @since 1.2
- */
- public static void setConverterProperty(FacesContext context,
- UIComponent component, ValueExpression value)
- {
- if (value != null)
- {
- if (component instanceof ValueHolder)
- {
- if (value.isLiteralText())
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Converter converter = facesContext.getApplication()
- .createConverter(value.getExpressionString());
- ((ValueHolder) component).setConverter(converter);
- }
- else
- {
- component.setValueExpression(JSFAttr.CONVERTER_ATTR, value);
- }
- }
- else
- {
- log.severe("Component " + component.getClass().getName()
- + " is no ValueHolder, cannot set value.");
- }
- }
- }
-
- /**
- * @since 1.2
- */
- public static void addValidatorProperty(FacesContext context,
- UIComponent component, MethodExpression validator)
- {
- if (validator != null)
- {
- if (!(component instanceof EditableValueHolder))
- {
- throw new IllegalArgumentException("Component "
- + component.getClientId(context)
- + " is no EditableValueHolder");
- }
-
- ((EditableValueHolder) component)
- .addValidator(new MethodExpressionValidator(validator));
- }
- }
-
- /**
- * @since 1.2
- */
- public static void setValueBinding(FacesContext context,
- UIComponent component, String propName, ValueExpression value)
- {
- if (value != null)
- {
- if (!value.isLiteralText())
- {
- component.setValueExpression(propName, value);
- }
- else
- {
- throw new IllegalArgumentException("Component "
- + component.getClientId(context) + " attribute "
- + propName + " must be a value reference, was " + value);
- }
- }
- }
-
- /**
- * @since 1.2
- */
- public static void setActionProperty(FacesContext context,
- UIComponent component, MethodExpression action)
- {
- if (action != null)
- {
- if (!(component instanceof ActionSource2))
- {
- throw new IllegalArgumentException("Component "
- + component.getClientId(context)
- + " is no ActionSource2");
- }
-
- ((ActionSource2) component).setActionExpression(action);
- }
- }
-
- /**
- * @since 1.2
- */
- public static void addActionListenerProperty(FacesContext context,
- UIComponent component, MethodExpression actionListener)
- {
- if (actionListener != null)
- {
- if (!(component instanceof ActionSource2))
- {
- throw new IllegalArgumentException("Component "
- + component.getClientId(context)
- + " is no ActionSource");
- }
-
- ((ActionSource2) component)
- .addActionListener(new MethodExpressionActionListener(
- actionListener));
- }
- }
-
- /**
- * @since 1.2
- */
- public static void addValueChangedListenerProperty(FacesContext context,
- UIComponent component, MethodExpression valueChangedListener)
- {
- if (valueChangedListener != null)
- {
- if (!(component instanceof EditableValueHolder))
- {
- throw new IllegalArgumentException("Component "
- + component.getClientId(context)
- + " is no EditableValueHolder");
- }
-
- ((EditableValueHolder) component)
- .addValueChangeListener(new MethodExpressionValueChangeListener(
- valueChangedListener));
- }
- }
-
- /**
- * @since 1.2
- */
- public static Object evaluateValueExpression(ELContext elContext,
- ValueExpression valueExpression)
- {
- return valueExpression.isLiteralText() ? valueExpression
- .getExpressionString() : valueExpression.getValue(elContext);
- }
-
- /**
- * @since 1.2
- */
- public static Boolean getBooleanValue(ELContext elContext,
- ValueExpression valueExpression)
- {
- if (valueExpression.isLiteralText())
- {
- return Boolean.valueOf(valueExpression.getExpressionString());
- }
-
- return (Boolean) valueExpression.getValue(elContext);
- }
-
- public static Integer getIntegerValue(ELContext elContext,
- ValueExpression valueExpression)
- {
- if (valueExpression.isLiteralText())
- {
- return Integer.valueOf(valueExpression.getExpressionString());
- }
-
- return (Integer) valueExpression.getValue(elContext);
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateDoubleRangeTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateDoubleRangeTag.java
deleted file mode 100755
index d123ff1..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateDoubleRangeTag.java
+++ /dev/null
@@ -1,65 +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.taglib.core;
-
-import org.apache.myfaces.util.ConverterUtils;
-
-import jakarta.faces.validator.DoubleRangeValidator;
-import jakarta.faces.validator.Validator;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * @author Thomas Spiegl (latest modification by $Author$)
- * @author Manfred Geiler
- * @version $Revision$ $Date$
- */
-public class ValidateDoubleRangeTag extends GenericMinMaxValidatorTag<Double>
-{
- private static final long serialVersionUID = 6396116656224588016L;
-
- private static final String VALIDATOR_ID = "jakarta.faces.DoubleRange";
-
- @Override
- protected Validator createValidator() throws JspException
- {
- setValidatorIdString(VALIDATOR_ID);
- DoubleRangeValidator validator = (DoubleRangeValidator)super.createValidator();
- if (null != _min)
- {
- validator.setMinimum(_min);
- }
- if (null != _max)
- {
- validator.setMaximum(_max);
- }
- return validator;
- }
-
- @Override
- protected boolean isMinLTMax()
- {
- return _min < _max;
- }
-
- @Override
- protected Double getValue(Object value)
- {
- return ConverterUtils.convertToDouble(value);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateLengthTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateLengthTag.java
deleted file mode 100755
index 4e78a18..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateLengthTag.java
+++ /dev/null
@@ -1,65 +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.taglib.core;
-
-import org.apache.myfaces.util.ConverterUtils;
-
-import jakarta.faces.validator.LengthValidator;
-import jakarta.faces.validator.Validator;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * @author Thomas Spiegl (latest modification by $Author$)
- * @author Manfred Geiler
- * @version $Revision$ $Date$
- */
-public class ValidateLengthTag extends GenericMinMaxValidatorTag<Integer>
-{
- private static final long serialVersionUID = 4858632671998693059L;
-
- private static final String VALIDATOR_ID = "jakarta.faces.Length";
-
- @Override
- protected Validator createValidator() throws JspException
- {
- setValidatorIdString(VALIDATOR_ID);
- LengthValidator validator = (LengthValidator)super.createValidator();
- if (null != _min)
- {
- validator.setMinimum(_min);
- }
- if (null != _max)
- {
- validator.setMaximum(_max);
- }
- return validator;
- }
-
- @Override
- protected boolean isMinLTMax()
- {
- return _min <= _max;
- }
-
- @Override
- protected Integer getValue(Object value)
- {
- return ConverterUtils.convertToInt(value);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateLongRangeTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateLongRangeTag.java
deleted file mode 100755
index 53fa1eb..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateLongRangeTag.java
+++ /dev/null
@@ -1,65 +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.taglib.core;
-
-import org.apache.myfaces.util.ConverterUtils;
-
-import jakarta.faces.validator.LongRangeValidator;
-import jakarta.faces.validator.Validator;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * @author Thomas Spiegl (latest modification by $Author$)
- * @author Manfred Geiler
- * @version $Revision$ $Date$
- */
-public class ValidateLongRangeTag extends GenericMinMaxValidatorTag<Long>
-{
- private static final long serialVersionUID = -8259560474198200978L;
-
- private static final String VALIDATOR_ID = "jakarta.faces.LongRange";
-
- @Override
- protected Validator createValidator() throws JspException
- {
- setValidatorIdString(VALIDATOR_ID);
- LongRangeValidator validator = (LongRangeValidator)super.createValidator();
- if (null != _min)
- {
- validator.setMinimum(_min);
- }
- if (null != _max)
- {
- validator.setMaximum(_max);
- }
- return validator;
- }
-
- @Override
- protected boolean isMinLTMax()
- {
- return _min < _max;
- }
-
- @Override
- protected Long getValue(Object value)
- {
- return ConverterUtils.convertToLong(value);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateRegexTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateRegexTag.java
deleted file mode 100644
index 704153f..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateRegexTag.java
+++ /dev/null
@@ -1,111 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.application.Application;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.validator.RegexValidator;
-import jakarta.faces.validator.Validator;
-import jakarta.faces.webapp.ValidatorELTag;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * JSP Tag class for {@link jakarta.faces.validator.RegexValidator}.
- *
- * @author Jan-Kees van Andel
- * @since 2.0
- */
-public class ValidateRegexTag extends ValidatorELTag
-{
- private static final long serialVersionUID = 8363913774859484811L;
-
- private ValueExpression _pattern;
-
- private ValueExpression _binding;
-
- @Override
- protected Validator createValidator() throws JspException
- {
- FacesContext fc = FacesContext.getCurrentInstance();
- ELContext elc = fc.getELContext();
- if (_binding != null)
- {
- Object validator;
- try
- {
- validator = _binding.getValue(elc);
- }
- catch (Exception e)
- {
- throw new JspException("Error while creating the Validator", e);
- }
- if (validator instanceof RegexValidator)
- {
- return (Validator)validator;
- }
- }
- if (null != _pattern)
- {
- Application appl = fc.getApplication();
- RegexValidator validator = (RegexValidator) appl.createValidator(RegexValidator.VALIDATOR_ID);
- String pattern = (String)_pattern.getValue(elc);
- validator.setPattern(pattern);
-
- if (_binding != null)
- {
- _binding.setValue(elc, validator);
- }
-
- return validator;
- }
- else
- {
- throw new AssertionError("pattern may not be null");
- }
- }
-
- public ValueExpression getBinding()
- {
- return _binding;
- }
-
- public void setBinding(ValueExpression binding)
- {
- _binding = binding;
- }
-
- public ValueExpression getPattern()
- {
- return _pattern;
- }
-
- public void setPattern(ValueExpression pattern)
- {
- _pattern = pattern;
- }
-
- @Override
- public void release()
- {
- _pattern = null;
- _binding = null;
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateRequiredTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateRequiredTag.java
deleted file mode 100644
index ec9509a..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidateRequiredTag.java
+++ /dev/null
@@ -1,97 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.application.Application;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.validator.RequiredValidator;
-import jakarta.faces.validator.Validator;
-import jakarta.faces.webapp.ValidatorELTag;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * JSP Tag class for {@link jakarta.faces.validator.RequiredValidator}.
- *
- * @author Leonardo Uribe
- * @since 2.0
- */
-public class ValidateRequiredTag extends ValidatorELTag
-{
- /**
- *
- */
- private static final long serialVersionUID = 6569308536432242026L;
-
- private ValueExpression _binding;
-
- public void setBinding(ValueExpression binding)
- {
- _binding = binding;
- }
-
- @Override
- public void release()
- {
- _binding = null;
- }
-
- @Override
- protected Validator createValidator() throws JspException
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
- if (null != _binding)
- {
- Object validator;
- try
- {
- validator = _binding.getValue(elContext);
- }
- catch (Exception e)
- {
- throw new JspException("Error while creating the Validator", e);
- }
- if (validator instanceof RequiredValidator)
- {
- return (Validator)validator;
- }
- }
- Application application = facesContext.getApplication();
- RequiredValidator validator = null;
- try
- {
- validator = (RequiredValidator) application.createValidator(RequiredValidator.VALIDATOR_ID);
- }
- catch (Exception e)
- {
- throw new JspException("Error while creating the Validator", e);
- }
-
- if (null != validator)
- {
- if (null != _binding)
- {
- _binding.setValue(elContext, validator);
- }
- }
- return validator;
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidatorImplTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValidatorImplTag.java
deleted file mode 100644
index cb74c3d..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidatorImplTag.java
+++ /dev/null
@@ -1,167 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.application.Application;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.validator.Validator;
-import jakarta.faces.webapp.ValidatorELTag;
-import jakarta.servlet.jsp.JspException;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-
-/**
- * Creates a validator and associates it with the nearest parent UIComponent.
- * <p>
- * During the validation phase (or the apply-request-values phase for immediate components), if the associated component
- * has any submitted value and the conversion of that value to the required type has succeeded then the specified
- * validator type is invoked to test the validity of the converted value.
- * </p>
- * <p>
- * Commonly associated with an h:inputText entity, but may be applied to any input component.
- * </p>
- * <p>
- * Some validators may allow the component to use attributes to define component-specific validation constraints; see
- * the f:attribute tag. See also the "validator" attribute of all input components, which allows a component to specify
- * an arbitrary validation <i>method</i> (rather than a registered validation type, as this tag does).
- * </p>
- * <p>
- * Unless otherwise specified, all attributes accept static values or EL expressions.
- * </p>
- *
- * @author Leonardo Uribe (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-@JSFJspTag(name = "f:validator", bodyContent = "empty")
-public class ValidatorImplTag extends ValidatorELTag
-{
- private ValueExpression _validatorId;
- private ValueExpression _binding;
- private String _validatorIdString = null;
-
- /**
- * The registered ID of the desired Validator.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.String")
- public void setValidatorId(ValueExpression validatorId)
- {
- _validatorId = validatorId;
- }
-
- /**
- * A ValueExpression that evaluates to an implementation of the jakarta.faces.validator.Validator interface.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="jakarta.faces.validator.Validator")
- public void setBinding(ValueExpression binding)
- {
- _binding = binding;
- }
-
- /**
- * Use this method to specify the validatorId programmatically.
- *
- * @param validatorIdString
- */
- public void setValidatorIdString(String validatorIdString)
- {
- _validatorIdString = validatorIdString;
- }
-
- @Override
- public void release()
- {
- super.release();
- _validatorId = null;
- _binding = null;
- _validatorIdString = null;
- }
-
- @Override
- protected Validator createValidator() throws jakarta.servlet.jsp.JspException
- {
-
- if (_validatorIdString != null)
- {
- return this.createClassicValidator();
- }
- if (_validatorId != null && _validatorId.isLiteralText())
- {
- return this.createClassicValidator();
- }
-
- return new DelegateValidator(_validatorId, _binding, _validatorIdString);
- }
-
- protected Validator createClassicValidator() throws jakarta.servlet.jsp.JspException
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
- if (null != _binding)
- {
- Object validator;
- try
- {
- validator = _binding.getValue(elContext);
- }
- catch (Exception e)
- {
- throw new JspException("Error while creating the Validator", e);
- }
- if (validator instanceof Validator)
- {
- return (Validator)validator;
- }
- }
- Application application = facesContext.getApplication();
- Validator validator = null;
- try
- {
- // first check if an ValidatorId was set by a method
- if (null != _validatorIdString)
- {
- validator = application.createValidator(_validatorIdString);
- }
- else if (null != _validatorId)
- {
- String validatorId = (String)_validatorId.getValue(elContext);
- validator = application.createValidator(validatorId);
- }
- }
- catch (Exception e)
- {
- throw new JspException("Error while creating the Validator", e);
- }
-
- if (null != validator)
- {
- if (null != _binding)
- {
- _binding.setValue(elContext, validator);
- }
- return validator;
- }
- throw new JspException("validatorId and/or binding must be specified");
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidatorTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValidatorTag.java
deleted file mode 100644
index 07c7996..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValidatorTag.java
+++ /dev/null
@@ -1,123 +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.taglib.core;
-
-import jakarta.el.ELContext;
-import jakarta.el.ValueExpression;
-import jakarta.faces.application.Application;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.validator.Validator;
-import jakarta.faces.webapp.ValidatorELTag;
-import jakarta.servlet.jsp.JspException;
-
-/**
- * Basic Validator implementation.
- *
- * @author Andreas Berger (latest modification by $Author$)
- * @version $Revision$ $Date$
- * @since 1.2
- */
-public class ValidatorTag extends ValidatorELTag
-{
- private ValueExpression _validatorId;
- private ValueExpression _binding;
- private String _validatorIdString = null;
-
- public void setValidatorId(ValueExpression validatorId)
- {
- _validatorId = validatorId;
- }
-
- public void setBinding(ValueExpression binding)
- {
- _binding = binding;
- }
-
- /**
- * Use this method to specify the validatorId programmatically.
- *
- * @param validatorIdString
- */
- public void setValidatorIdString(String validatorIdString)
- {
- _validatorIdString = validatorIdString;
- }
-
- @Override
- public void release()
- {
- super.release();
- _validatorId = null;
- _binding = null;
- _validatorIdString = null;
- }
-
- @Override
- protected Validator createValidator() throws jakarta.servlet.jsp.JspException
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
- if (null != _binding)
- {
- Object validator;
- try
- {
- validator = _binding.getValue(elContext);
- }
- catch (Exception e)
- {
- throw new JspException("Error while creating the Validator", e);
- }
- if (validator instanceof Validator)
- {
- return (Validator)validator;
- }
- }
- Application application = facesContext.getApplication();
- Validator validator = null;
- try
- {
- // first check if an ValidatorId was set by a method
- if (null != _validatorIdString)
- {
- validator = application.createValidator(_validatorIdString);
- }
- else if (null != _validatorId)
- {
- String validatorId = (String)_validatorId.getValue(elContext);
- validator = application.createValidator(validatorId);
- }
- }
- catch (Exception e)
- {
- throw new JspException("Error while creating the Validator", e);
- }
-
- if (null != validator)
- {
- if (null != _binding)
- {
- _binding.setValue(elContext, validator);
- }
- return validator;
- }
- throw new JspException("validatorId and/or binding must be specified");
- }
-
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ValueChangeListenerTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ValueChangeListenerTag.java
deleted file mode 100755
index 5764c47..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ValueChangeListenerTag.java
+++ /dev/null
@@ -1,88 +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.taglib.core;
-
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.EditableValueHolder;
-import jakarta.faces.event.ValueChangeListener;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-
-/**
- * Adds the specified ValueChangeListener to the nearest parent UIComponent (which is expected to be a UIInput
- * component).
- * <p>
- * Whenever the form containing the parent UIComponent is submitted, an instance of the specified type is created. If
- * the submitted value from the component is different from the component's current value then a ValueChangeEvent is
- * queued. When the ValueChangeEvent is processed (at end of the validate phase for non-immediate components, or at end
- * of the apply-request-values phase for immediate components) the object's processValueChange method is invoked.
- * </p>
- * <p>
- * Unless otherwise specified, all attributes accept static values or EL expressions.
- * </p>
- *
- * @author Manfred Geiler (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-@JSFJspTag(name = "f:valueChangeListener", bodyContent = "empty")
-public class ValueChangeListenerTag extends GenericListenerTag<EditableValueHolder, ValueChangeListener>
-{
- private static final long serialVersionUID = 2155190261951046892L;
-
- public ValueChangeListenerTag()
- {
- super(EditableValueHolder.class);
- }
-
- @Override
- protected void addListener(EditableValueHolder editableValueHolder, ValueChangeListener valueChangeListener)
- {
- editableValueHolder.addValueChangeListener(valueChangeListener);
- }
-
- @Override
- protected ValueChangeListener createDelegateListener(ValueExpression type, ValueExpression binding)
- {
- return new DelegateValueChangeListener(type, binding);
- }
-
- /**
- * The name of a Java class that implements ValueChangeListener.
- */
- @Override
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.String")
- public void setType(ValueExpression type)
- {
- super.setType(type);
- }
-
- /**
- * Value binding expression that evaluates to an implementation of the jakarta.faces.event.ValueChangeListener
- * interface.
- */
- @Override
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="jakarta.faces.event.ValueChangeListener")
- public void setBinding(ValueExpression binding)
- {
- super.setBinding(binding);
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/VerbatimTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/VerbatimTag.java
deleted file mode 100755
index ae493fa..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/VerbatimTag.java
+++ /dev/null
@@ -1,102 +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.taglib.core;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag;
-import org.apache.myfaces.renderkit.html.util.JSFAttr;
-
-import jakarta.el.ValueExpression;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.component.UIOutput;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.tagext.BodyContent;
-
-/**
- * @author Manfred Geiler (latest modification by $Author$)
- * @version $Revision$ $Date$
- */
-@JSFJspTag(name = "f:verbatim", bodyContent = "JSP")
-public class VerbatimTag extends UIComponentELTagBase
-{
- // private static final Log log = LogFactory.getLog(VerbatimTag.class);
-
- @Override
- public String getComponentType()
- {
- return "jakarta.faces.Output";
- }
-
- @Override
- public String getRendererType()
- {
- return "jakarta.faces.Text";
- }
-
- // HtmlOutputText attributes
- private ValueExpression _escape;
- private ValueExpression _rendered;
-
- @Override
- protected void setProperties(UIComponent component)
- {
- super.setProperties(component);
-
- setBooleanProperty(component, JSFAttr.ESCAPE_ATTR, _escape, Boolean.FALSE);
- setBooleanProperty(component, JSFAttr.RENDERED, _rendered, Boolean.TRUE);
-
- // No need to save component state
- component.setTransient(true);
- }
-
- /**
- * If true, generated markup is escaped. Default: false.
- */
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.Boolean")
- public void setEscape(ValueExpression escape)
- {
- _escape = escape;
- }
-
- /**
- * Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on
- * any subsequent form submit. The default value for this property is true.
- */
- @Override
- @JSFJspAttribute(className="jakarta.el.ValueExpression",
- deferredValueType="java.lang.Boolean")
- public void setRendered(ValueExpression rendered)
- {
- _rendered = rendered;
- }
-
- @Override
- public int doAfterBody() throws JspException
- {
- BodyContent bodyContent = getBodyContent();
- if (bodyContent != null)
- {
- UIOutput component = (UIOutput)getComponentInstance();
- component.setValue(bodyContent.getString());
- bodyContent.clearBody();
- }
- return super.getDoAfterBodyValue();
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/taglib/core/ViewTag.java b/impl/src/main/java/org/apache/myfaces/taglib/core/ViewTag.java
deleted file mode 100755
index b0d6632..0000000
--- a/impl/src/main/java/org/apache/myfaces/taglib/core/ViewTag.java
+++ /dev/null
@@ -1,261 +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.taglib.core;
-
-import java.io.IOException;
-import java.util.Locale;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import jakarta.el.ELContext;
-import jakarta.el.MethodExpression;
-import jakarta.el.ValueExpression;
-import jakarta.faces.FacesException;
-import jakarta.faces.component.UIComponent;
-import jakarta.faces.component.UIViewRoot;
-import jakarta.faces.context.FacesContext;
-import jakarta.faces.render.RenderKitFactory;
-import jakarta.faces.webapp.UIComponentELTag;
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.jstl.core.Config;
-
-import org.apache.myfaces.view.ServletViewResponseWrapper;
-import org.apache.myfaces.util.LocaleUtils;
-
-/**
- * @author Manfred Geiler (latest modification by $Author$)
- * @author Bruno Aranda (JSR-252)
- * @version $Revision$ $Date$
- */
-public class ViewTag extends UIComponentELTag
-{
- private static final Logger log = Logger.getLogger(ViewTag.class.getName());
-
- @Override
- public String getComponentType()
- {
- return UIViewRoot.COMPONENT_TYPE;
- }
-
- @Override
- public String getRendererType()
- {
- return null;
- }
-
- private ValueExpression _locale;
- private ValueExpression _renderKitId;
-
- private MethodExpression _beforePhase;
- private MethodExpression _afterPhase;
-
- public void setLocale(ValueExpression locale)
- {
- _locale = locale;
- }
-
- public void setRenderKitId(ValueExpression renderKitId)
- {
- _renderKitId = renderKitId;
- }
-
- public void setBeforePhase(MethodExpression beforePhase)
- {
- _beforePhase = beforePhase;
- }
-
- public void setAfterPhase(MethodExpression afterPhase)
- {
- _afterPhase = afterPhase;
- }
-
- @Override
- public int doStartTag() throws JspException
- {
- if (log.isLoggable(Level.FINEST))
- {
- log.finest("entering ViewTag.doStartTag");
- }
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- Object response = facesContext.getExternalContext().getResponse();
- if (response instanceof ServletViewResponseWrapper)
- {
- try
- {
- pageContext.getOut().flush();
- ((ServletViewResponseWrapper)response).flushToWrappedResponse();
- }
- catch (IOException e)
- {
- throw new JspException("Can't write content above <f:view> tag" + ' ' + e.getMessage());
- }
- }
-
- int retVal = super.doStartTag();
-
- Config.set(pageContext.getRequest(), Config.FMT_LOCALE, facesContext.getViewRoot().getLocale());
-
- if (log.isLoggable(Level.FINEST))
- {
- log.finest("leaving ViewTag.doStartTag");
- }
- return retVal;
- }
-
- @Override
- public int doEndTag() throws JspException
- {
- if (log.isLoggable(Level.FINEST))
- {
- log.finest("entering ViewTag.doEndTag");
- }
- int retVal = super.doEndTag();
-
- if (log.isLoggable(Level.FINEST))
- {
- log.finest("leaving ViewTag.doEndTag");
- }
- return retVal;
- }
-
- @Override
- public int doAfterBody() throws JspException
- {
- if (log.isLoggable(Level.FINEST))
- {
- log.finest("entering ViewTag.doAfterBody");
- }
-
- UIComponent verbatimComp = createVerbatimComponentFromBodyContent();
-
- if (verbatimComp != null)
- {
- FacesContext.getCurrentInstance().getViewRoot().getChildren().add(verbatimComp);
- }
-
- if (log.isLoggable(Level.FINEST))
- {
- log.finest("leaving ViewTag.doAfterBody");
- }
- return EVAL_PAGE;
- }
-
- @Override
- protected void setProperties(UIComponent component)
- {
- super.setProperties(component);
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
- ELContext elContext = facesContext.getELContext();
-
- UIViewRoot viewRoot = (UIViewRoot)component;
-
- // locale
- if (_locale != null)
- {
- Locale locale;
- if (_locale.isLiteralText())
- {
- locale = LocaleUtils.toLocale(_locale.getValue(elContext).toString());
- }
- else
- {
- component.setValueExpression("locale", _locale);
-
- Object localeValue = _locale.getValue(elContext);
-
- if (localeValue instanceof Locale)
- {
- locale = (Locale)localeValue;
- }
- else if (localeValue instanceof String)
- {
- locale = LocaleUtils.toLocale((String)localeValue);
- }
- else
- {
- if (localeValue != null)
- {
- throw new IllegalArgumentException("Locale or String class expected. Expression: " + _locale
- + ". Return class: " + localeValue.getClass().getName());
- }
-
- throw new IllegalArgumentException("Locale or String class expected. Expression: " + _locale
- + ". Return value null");
- }
- }
- viewRoot.setLocale(locale);
- Config.set(pageContext.getRequest(), Config.FMT_LOCALE, locale);
- }
-
- // renderkitId
- if (_renderKitId != null)
- {
- if (_renderKitId.isLiteralText())
- {
- viewRoot.setRenderKitId(_renderKitId.getValue(elContext).toString());
- }
- else
- {
- viewRoot.setValueExpression("renderKitId", _renderKitId);
- viewRoot.setRenderKitId(null);
- }
- }
- else if (viewRoot.getRenderKitId() == null)
- {
- String defaultRenderKitId = facesContext.getApplication().getDefaultRenderKitId();
-
- if (defaultRenderKitId != null)
- {
- viewRoot.setRenderKitId(defaultRenderKitId);
- }
- else
- {
- viewRoot.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
- }
- }
-
- // beforePhase
- if (_beforePhase != null)
- {
- if (_beforePhase.isLiteralText())
- {
- throw new FacesException("Invalid method expression for attribute 'beforePhase' in the view tag: "
- + _beforePhase.getExpressionString());
- }
-
- viewRoot.setBeforePhaseListener(_beforePhase);
-
- }
-
- // afterPhase
- if (_afterPhase != null)
- {
- if (_afterPhase.isLiteralText())
- {
- throw new FacesException("Invalid method expression for attribute 'beforePhase' in the view tag: "
- + _afterPhase.getExpressionString());
- }
-
- viewRoot.setAfterPhaseListener(_afterPhase);
-
- }
- }
-}
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ActionListenerHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ActionListenerHandler.java
index 1d8450f..313e1e4 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ActionListenerHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ActionListenerHandler.java
@@ -54,10 +54,7 @@ import org.apache.myfaces.view.facelets.FaceletCompositionContext;
* @author Jacob Hookom
* @version $Id$
*/
-@JSFFaceletTag(
- name = "f:actionListener",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.ActionListenerTag")
+@JSFFaceletTag(name = "f:actionListener", bodyContent = "empty")
public final class ActionListenerHandler extends TagHandler
implements ActionSource2AttachedObjectHandler
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AttributeHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AttributeHandler.java
index a3d25f9..ae6c8ee 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AttributeHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/AttributeHandler.java
@@ -41,10 +41,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFacelet
* @author Jacob Hookom
* @version $Id$
*/
-@JSFFaceletTag(
- name = "f:attribute",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.AttributeTag")
+@JSFFaceletTag(name = "f:attribute", bodyContent = "empty")
public final class AttributeHandler extends TagHandler
implements jakarta.faces.view.facelets.AttributeHandler
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ConvertDelegateHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ConvertDelegateHandler.java
index 2851097..f66ac2c 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ConvertDelegateHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ConvertDelegateHandler.java
@@ -36,10 +36,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFacelet
* @author Jacob Hookom
* @version $Id$
*/
-@JSFFaceletTag(
- name = "f:converter",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.ConverterImplTag")
+@JSFFaceletTag(name = "f:converter", bodyContent = "empty")
public final class ConvertDelegateHandler extends ConverterHandler
{
private final TagAttribute converterId;
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/LoadBundleHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/LoadBundleHandler.java
index a65319c..adf95c5 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/LoadBundleHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/LoadBundleHandler.java
@@ -51,10 +51,7 @@ import org.apache.myfaces.view.facelets.tag.jsf.ComponentSupport;
* @author Jacob Hookom
* @version $Id$
*/
-@JSFFaceletTag(
- name = "f:loadBundle",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.LoadBundleTag")
+@JSFFaceletTag(name = "f:loadBundle", bodyContent = "empty")
public final class LoadBundleHandler extends TagHandler
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/PhaseListenerHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/PhaseListenerHandler.java
index 08d359a..99dcc9e 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/PhaseListenerHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/PhaseListenerHandler.java
@@ -44,10 +44,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFacelet
import org.apache.myfaces.util.lang.ClassUtils;
import org.apache.myfaces.view.facelets.tag.jsf.ComponentSupport;
-@JSFFaceletTag(
- name = "f:phaseListener",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.PhaseListenerTag")
+@JSFFaceletTag(name = "f:phaseListener", bodyContent = "empty")
public class PhaseListenerHandler extends TagHandler
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
index 4134e82..a8413a6 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/SetPropertyActionListenerHandler.java
@@ -48,10 +48,7 @@ import org.apache.myfaces.view.facelets.FaceletCompositionContext;
import org.apache.myfaces.view.facelets.el.ContextAware;
import org.apache.myfaces.view.facelets.el.ContextAwareELException;
-@JSFFaceletTag(
- name = "f:setPropertyActionListener",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.SetPropertyActionListenerTag")
+@JSFFaceletTag(name = "f:setPropertyActionListener", bodyContent = "empty")
public class SetPropertyActionListenerHandler extends TagHandler
implements ActionSource2AttachedObjectHandler
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValidateDelegateHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValidateDelegateHandler.java
index 3996bee..8e789fd 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValidateDelegateHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValidateDelegateHandler.java
@@ -36,10 +36,7 @@ import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFFacelet
* @author Jacob Hookom
* @version $Id$
*/
-@JSFFaceletTag(
- name = "f:validator",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.ValidatorImplTag")
+@JSFFaceletTag(name = "f:validator", bodyContent = "empty")
@JSFFaceletAttribute(name="disabled", deferredValueType="java.lang.Boolean",
desc="no description", longDescription="no description")
public final class ValidateDelegateHandler extends ValidatorHandler
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java
index f0fc967..edff2df 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValueChangeListenerHandler.java
@@ -52,10 +52,7 @@ import org.apache.myfaces.view.facelets.FaceletCompositionContext;
* @author Jacob Hookom
* @version $Id$
*/
-@JSFFaceletTag(
- name = "f:valueChangeListener",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.ValueChangeListenerTag")
+@JSFFaceletTag(name = "f:valueChangeListener", bodyContent = "empty")
public final class ValueChangeListenerHandler extends TagHandler
implements EditableValueHolderAttachedObjectHandler
{
diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/VerbatimHandler.java b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/VerbatimHandler.java
index e3e3444..5c5d156 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/VerbatimHandler.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/VerbatimHandler.java
@@ -33,10 +33,7 @@ import org.apache.myfaces.view.facelets.tag.TagHandlerUtils;
* @author Adam Winer
* @version $Id$
*/
-@JSFFaceletTag(
- name = "f:verbatim",
- bodyContent = "empty",
- tagClass="org.apache.myfaces.taglib.core.VerbatimTag")
+@JSFFaceletTag(name = "f:verbatim", bodyContent = "empty")
public final class VerbatimHandler extends ComponentHandler
{
public VerbatimHandler(ComponentConfig config)
diff --git a/impl/src/main/resources/META-INF/tagClass12.vm b/impl/src/main/resources/META-INF/tagClass12.vm
deleted file mode 100644
index 17fdf48..0000000
--- a/impl/src/main/resources/META-INF/tagClass12.vm
+++ /dev/null
@@ -1,192 +0,0 @@
-// WARNING: This file was automatically generated. Do not edit it directly,
-// or you will lose your changes.
-/*
- * 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 ${component.tagPackage};
-
-import jakarta.faces.component.UIComponent;
-import jakarta.el.ValueExpression;
-import jakarta.el.MethodExpression;
-## import jakarta.faces.context.FacesContext;
-$utils.importTagClasses12($component)
-
-// Generated from class ${component.sourceClassName}.
-//
-// WARNING: This file was automatically generated. Do not edit it directly,
-// or you will lose your changes.
-public class $utils.getClassFromFullClass($component.tagClass)
-#if (${component.tagSuperclass})
- extends ${component.tagSuperclass}
-#else
- extends jakarta.faces.webapp.UIComponentTag
-#end
-{
- public $utils.getClassFromFullClass($component.tagClass)()
- {
- }
-
- @Override
- public String getComponentType()
- {
-#if ($component.type)
-## see MYFACES-1790 HtmlColumnTag.getComponentType returns the wrong value
-#if ($component.type == "jakarta.faces.HtmlColumn")
- return "jakarta.faces.Column";
-#else
- return "$component.type";
-#end
-#else
- return null;
-#end
- }
-
- public String getRendererType()
- {
-#if ($component.rendererType && !($component.rendererType == ""))
- return "$component.rendererType";
-#else
- return null;
-#end
- }
-
-#set ($propertyList = ${component.propertyTagList})
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#set ($type = $utils.getJspPropertyType12($property))
-#if ($property.isLiteralOnly() && $property.className == "boolean")
-#set ($type = "String")
-#end
- private $type $field;
-
-#set ($var = $utils.getVariableFromName($property.name))
- public void $utils.getPrefixedPropertyName("set", $property.jspName)($type $var)
- {
- $field = $var;
- }
-#end
-
- @Override
- protected void setProperties(UIComponent component)
- {
-## see MYFACES-1790 HtmlColumnTag.getComponentType returns the wrong value
-#set ($className = $component.className)
-#if($className == "jakarta.faces.component.html.HtmlColumn")
-#set ($className = "jakarta.faces.component.UIColumn")
-#end
- if (!(component instanceof $className ))
- {
- throw new IllegalArgumentException("Component "+
- component.getClass().getName() +" is no $component.className");
- }
-
- $className comp = ($className) component;
-
- super.setProperties(component);
-
-## FacesContext context = getFacesContext();
-
-#foreach( $property in $propertyList )## 1
-#set ($field = $property.fieldName)
-#set ($type = $utils.getJspPropertyType12($property))
-#if ($property.isLiteralOnly() && $property.className == "boolean")
-#set ($type = "String")
-#end
-#if ($utils.isConverter($property.className))## 2
- if ($field != null)
- {
- if (!${field}.isLiteralText())
- {
- comp.setValueExpression("$property.name", $field);
- }
- else
- {
- String s = ${field}.getExpressionString();
- if (s != null)
- {
- Converter converter = getFacesContext().getApplication().createConverter(s);
- comp.setConverter(converter);
- }
- }
- }
-#elseif ($property.isMethodBinding())## 2
- if ($field != null)
- {
-#if ($property.jspName == "actionListener")
- comp.addActionListener(new MethodExpressionActionListener($field));
-#elseif ($property.jspName == "valueChangeListener")
- comp.addValueChangeListener(new MethodExpressionValueChangeListener($field));
-#elseif ($property.jspName == "validator")
- comp.addValidator(new MethodExpressionValidator($field));
-#elseif ($utils.isStringMethodBindingReturnType($property.methodBindingSignature))##3
- MethodBinding mb;
- if (isValueReference($field))
- {
- mb = context.getApplication().createMethodBinding(
- $field, $utils.getSignatureParams($property.methodBindingSignature));
- }
- else
- {
- throw new IllegalStateException("Invalid expression " + $field);
- }
- comp.${utils.getPrefixedPropertyName("set",$property.name)}(mb);
-#else## 3
- MethodBinding mb = context.getApplication().createMethodBinding(
- $field, $utils.getSignatureParams($property.methodBindingSignature));
- comp.${utils.getPrefixedPropertyName("set",$property.name)}(mb);
-#end## 3
- }
-#elseif ($property.isMethodExpression())## 2
- if ($field != null)
- {
-#if ($property.jspName == "action")
- comp.setActionExpression($field);
-#elseif ($property.jspName == "actionListener")
- comp.addActionListener(new MethodExpressionActionListener($field));
-#else
- comp.${utils.getPrefixedPropertyName("set",$property.name)}($field);
-#end
- }
-#else## 2
- if ($field != null)
- {
-#if ($property.isLiteralOnly())## 3
-#if ($utils.isPrimitiveClass($property.className))## 4
- comp.getAttributes().put("$property.name", ${utils.getBoxedClass($property.className)}.valueOf($field));
-#else## 4
- comp.getAttributes().put("$property.name", $field);
-#end## 4
-#else## 3
- comp.setValueExpression("$property.name", $field);
-#end## 3
- }
-#end## 2
-#end## 1
- }
-
- @Override
- public void release()
- {
- super.release();
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#set ($empty = "null")
- $field = $empty;
-#end
- }
-}