You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/03/10 13:58:42 UTC
svn commit: r921334 - in /myfaces/extensions/scripting/trunk:
core/core/src/main/java/org/apache/myfaces/scripting/api/
core/core/src/main/java/org/apache/myfaces/scripting/core/reloading/
core/myfaces2-extensions/src/main/java/org/apache/myfaces/scrip...
Author: werpu
Date: Wed Mar 10 12:58:41 2010
New Revision: 921334
URL: http://svn.apache.org/viewvc?rev=921334&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-91
adding dynamic tag handlers for all important jsf2 tag handler artifacts which can be used by the user...
Added:
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/BehaviorHandlerReloadingStrategy.java (with props)
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ComponentHandlerReloadingStrategy.java (with props)
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ConverterHandlerReloadingStrategy.java (with props)
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingBehaviorTagHandlerDelegate.java (with props)
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingConverterTagHandlerDelegate.java (with props)
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingValidatorTagHandlerDelegate.java (with props)
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ValidatorHandlerReloadingStrategy.java (with props)
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/MyComponentTag.java (with props)
Modified:
myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingConst.java
myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/reloading/GlobalReloadingStrategy.java
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingComponentTagHandlerDelegate.java
myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/TagHandlerDelegateFactoryImpl.java
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml
myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml
Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingConst.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingConst.java?rev=921334&r1=921333&r2=921334&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingConst.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/ScriptingConst.java Wed Mar 10 12:58:41 2010
@@ -68,6 +68,14 @@ public class ScriptingConst {
public static final int ARTIFACT_TYPE_CLIENTBEHAVIORRENDERER = 20;
public static final int ARTIFACT_TYPE_SYSTEMEVENTLISTENER = 21;
+ //faclets artifacts
+ public static final int ARTIFACT_TYPE_TAG_HANDLER=22;
+ public static final int ARTIFACT_TYPE_COMPONENT_HANDLER=23;
+ public static final int ARTIFACT_TYPE_VALIDATOR_HANDLER=24;
+ public static final int ARTIFACT_TYPE_CONVERTER_HANDLER=25;
+ public static final int ARTIFACT_TYPE_BEHAVIOR_HANDLER=26;
+
+
public static final String CTX_REQUEST_CNT = "RequestCnt";
public static final String CTX_CONFIGURATION = "ExtScriptingConfig";
public static final String CTX_STARTUP = "ExtScriptingStartup";
Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/reloading/GlobalReloadingStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/reloading/GlobalReloadingStrategy.java?rev=921334&r1=921333&r2=921334&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/reloading/GlobalReloadingStrategy.java (original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/core/reloading/GlobalReloadingStrategy.java Wed Mar 10 12:58:41 2010
@@ -21,6 +21,9 @@ package org.apache.myfaces.scripting.cor
import org.apache.myfaces.scripting.api.ReloadingStrategy;
import org.apache.myfaces.scripting.api.ScriptingConst;
import org.apache.myfaces.scripting.api.ScriptingWeaver;
+import org.apache.myfaces.scripting.core.util.Cast;
+import org.apache.myfaces.scripting.core.util.ClassUtils;
+import org.apache.myfaces.scripting.core.util.ReflectUtil;
/**
* @author Werner Punz (latest modification by $Author$)
@@ -29,6 +32,8 @@ import org.apache.myfaces.scripting.api.
* A reloading strategy chain of responsibility which switches
* depending on the artifact type to the correct
* strategy
+ * <p/>
+ * TODO make the reloading strategy pluggable from outside!
*/
public class GlobalReloadingStrategy implements ReloadingStrategy {
@@ -39,6 +44,12 @@ public class GlobalReloadingStrategy imp
protected ReloadingStrategy _noMappingStrategy;
protected ReloadingStrategy _allOthers;
+ /*loaded dynamically for myfaces 2+*/
+ protected ReloadingStrategy _componentHandlerStrategy;
+ protected ReloadingStrategy _validatorHandlerStrategy;
+ protected ReloadingStrategy _converterHandlerStrategy;
+ protected ReloadingStrategy _behaviorHandlerStrategy;
+
public GlobalReloadingStrategy(ScriptingWeaver weaver) {
setWeaver(weaver);
}
@@ -71,6 +82,15 @@ public class GlobalReloadingStrategy imp
case ScriptingConst.ARTIFACT_TYPE_VALIDATOR:
return _noMappingStrategy.reload(toReload, artifactType);
//TODO Add other artifact loading strategies on demand here
+ case ScriptingConst.ARTIFACT_TYPE_COMPONENT_HANDLER:
+ return dynaReload(toReload, _componentHandlerStrategy, artifactType);
+ case ScriptingConst.ARTIFACT_TYPE_CONVERTER_HANDLER:
+ return dynaReload(toReload, _converterHandlerStrategy, artifactType);
+ case ScriptingConst.ARTIFACT_TYPE_VALIDATOR_HANDLER:
+ return dynaReload(toReload, _validatorHandlerStrategy, artifactType);
+ case ScriptingConst.ARTIFACT_TYPE_BEHAVIOR_HANDLER:
+ return dynaReload(toReload, _behaviorHandlerStrategy, artifactType);
+
default:
return _allOthers.reload(toReload, artifactType);
}
@@ -81,6 +101,40 @@ public class GlobalReloadingStrategy imp
_beanStrategy = new ManagedBeanReloadingStrategy(weaver);
_noMappingStrategy = new NoMappingReloadingStrategy(weaver);
_allOthers = new SimpleReloadingStrategy(weaver);
+
+ /*
+ * external handlers coming from various submodules
+ */
+ _componentHandlerStrategy = dynaload(weaver, "org.apache.myfaces.scripting.facelet.ComponentHandlerReloadingStrategy");
+ _validatorHandlerStrategy = dynaload(weaver, "org.apache.myfaces.scripting.facelet.ValidatorHandlerReloadingStrategy");
+ _converterHandlerStrategy = dynaload(weaver, "org.apache.myfaces.scripting.facelet.ConverterHandlerReloadingStrategy");
+ _behaviorHandlerStrategy = dynaload(weaver, "org.apache.myfaces.scripting.facelet.BehaviorHandlerReloadingStrategy");
+ }
+
+ public Object dynaReload(Object toReload, ReloadingStrategy strategy, int artifactType) {
+ if (strategy == null) {
+ //no strategy no reload
+ return toReload;
+ } else {
+ return strategy.reload(toReload, artifactType);
+ }
+ }
+
+ /**
+ * load dynamically the given strategy class
+ *
+ * @param weaver the weaver which the new strateg class is applied to
+ * @param strategyClass the strategy class which has to be loaded and instantiated
+ * @return an instance of the strategy class if found otherwise null
+ */
+ private ReloadingStrategy dynaload(ScriptingWeaver weaver, String strategyClass) {
+ try {
+ Class componentStrategyClass = ClassUtils.forName(strategyClass);
+ return (ReloadingStrategy) ReflectUtil.instantiate(componentStrategyClass, new Cast(ScriptingWeaver.class, weaver));
+ } catch (RuntimeException ex) {
+ //in this case swallowing the exception is expected
+ }
+ return null;
}
public ScriptingWeaver getWeaver() {
Added: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/BehaviorHandlerReloadingStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/BehaviorHandlerReloadingStrategy.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/BehaviorHandlerReloadingStrategy.java (added)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/BehaviorHandlerReloadingStrategy.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,68 @@
+/*
+ * 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.scripting.facelet;
+
+import org.apache.myfaces.scripting.api.ScriptingWeaver;
+import org.apache.myfaces.scripting.core.reloading.SimpleReloadingStrategy;
+import org.apache.myfaces.scripting.core.util.Cast;
+import org.apache.myfaces.scripting.core.util.ReflectUtil;
+
+import javax.faces.view.facelets.BehaviorConfig;
+import javax.faces.view.facelets.BehaviorHandler;
+import javax.faces.view.facelets.ComponentHandler;
+
+/**
+ * The reloading strategy for our behavior tag handlers
+ * note since we do not have an official api we must
+ * enforce a getConverterConfig() method to allow
+ * the reloading of converter tag handlers
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class BehaviorHandlerReloadingStrategy extends SimpleReloadingStrategy {
+ public BehaviorHandlerReloadingStrategy(ScriptingWeaver weaver) {
+ super(weaver);
+ }
+
+ @Override
+ public Object reload(Object scriptingInstance, int artifactType) {
+ if (!(scriptingInstance instanceof ComponentHandler)) return scriptingInstance;
+ Class aclass = _weaver.reloadScriptingClass(scriptingInstance.getClass());
+ if (aclass.hashCode() == scriptingInstance.getClass().hashCode()) {
+ //class of this object has not changed although
+ // reload is enabled we can skip the rest now
+ return scriptingInstance;
+ }
+ BehaviorHandler oldHandler = (BehaviorHandler) scriptingInstance;
+ /**
+ *
+ */
+ BehaviorConfig config = (BehaviorConfig) ReflectUtil.executeMethod(oldHandler, "getBehaviorConfig");
+ BehaviorHandler newHandler = (BehaviorHandler) ReflectUtil.instantiate(aclass, new Cast(BehaviorConfig.class, config));
+
+ //save all pending non config related properties wherever possible
+ super.mapProperties(newHandler, oldHandler);
+
+ return newHandler;
+ }
+
+}
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/BehaviorHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/BehaviorHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ComponentHandlerReloadingStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ComponentHandlerReloadingStrategy.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ComponentHandlerReloadingStrategy.java (added)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ComponentHandlerReloadingStrategy.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,60 @@
+/*
+ * 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.scripting.facelet;
+
+import org.apache.myfaces.scripting.api.ScriptingWeaver;
+import org.apache.myfaces.scripting.core.reloading.SimpleReloadingStrategy;
+import org.apache.myfaces.scripting.core.util.Cast;
+import org.apache.myfaces.scripting.core.util.ReflectUtil;
+
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ComponentHandlerReloadingStrategy extends SimpleReloadingStrategy {
+
+ public ComponentHandlerReloadingStrategy(ScriptingWeaver weaver) {
+ super(weaver);
+ }
+
+ @Override
+ public Object reload(Object scriptingInstance, int artifactType) {
+ if (!(scriptingInstance instanceof ComponentHandler)) return scriptingInstance;
+ Class aclass = _weaver.reloadScriptingClass(scriptingInstance.getClass());
+ if (aclass.hashCode() == scriptingInstance.getClass().hashCode()) {
+ //class of this object has not changed although
+ // reload is enabled we can skip the rest now
+ return scriptingInstance;
+ }
+ ComponentHandler oldHandler = (ComponentHandler) scriptingInstance;
+ ComponentConfig config = oldHandler.getComponentConfig();
+ ComponentHandler newHandler = (ComponentHandler) ReflectUtil.instantiate(aclass, new Cast(ComponentConfig.class, config));
+
+ //save all pending non config related properties wherever possible
+ super.mapProperties(newHandler, oldHandler);
+
+ return newHandler;
+ }
+
+}
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ComponentHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ComponentHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ConverterHandlerReloadingStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ConverterHandlerReloadingStrategy.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ConverterHandlerReloadingStrategy.java (added)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ConverterHandlerReloadingStrategy.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,69 @@
+/*
+ * 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.scripting.facelet;
+
+import org.apache.myfaces.scripting.api.ScriptingWeaver;
+import org.apache.myfaces.scripting.core.reloading.SimpleReloadingStrategy;
+import org.apache.myfaces.scripting.core.util.Cast;
+import org.apache.myfaces.scripting.core.util.ReflectUtil;
+
+import javax.faces.view.facelets.*;
+
+/**
+ * The reloading strategy for our converter tag handlers
+ * note since we do not have an official api we must
+ * enforce a getConverterConfig() method to allow
+ * the reloading of converter tag handlers
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ConverterHandlerReloadingStrategy extends SimpleReloadingStrategy {
+
+ public ConverterHandlerReloadingStrategy(ScriptingWeaver weaver) {
+ super(weaver);
+ }
+
+ @Override
+ public Object reload(Object scriptingInstance, int artifactType) {
+ if (!(scriptingInstance instanceof ComponentHandler)) return scriptingInstance;
+ Class aclass = _weaver.reloadScriptingClass(scriptingInstance.getClass());
+ if (aclass.hashCode() == scriptingInstance.getClass().hashCode()) {
+ //class of this object has not changed although
+ // reload is enabled we can skip the rest now
+ return scriptingInstance;
+ }
+ ConverterHandler oldHandler = (ConverterHandler) scriptingInstance;
+ /**
+ *
+ */
+ ConverterConfig config = (ConverterConfig) ReflectUtil.executeMethod(oldHandler, "getConverterConfig");
+ ConverterHandler newHandler = (ConverterHandler) ReflectUtil.instantiate(aclass, new Cast(ConverterConfig.class, config));
+
+ //TODO check if the component is attached correctly after reloading
+
+ //save all pending non config related properties wherever possible
+ super.mapProperties(newHandler, oldHandler);
+
+ return newHandler;
+ }
+
+}
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ConverterHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ConverterHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingBehaviorTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingBehaviorTagHandlerDelegate.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingBehaviorTagHandlerDelegate.java (added)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingBehaviorTagHandlerDelegate.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,67 @@
+/*
+ * 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.scripting.facelet;
+
+import org.apache.myfaces.scripting.api.ScriptingConst;
+import org.apache.myfaces.scripting.core.util.WeavingContext;
+import org.apache.myfaces.view.facelets.tag.jsf.BehaviorTagHandlerDelegate;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.*;
+import java.io.IOException;
+
+/**
+ * Behavior Tag Handler which introduces reloading behavior
+ *
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ReloadingBehaviorTagHandlerDelegate extends TagHandlerDelegate {
+
+ BehaviorHandler _owner;
+ TagHandlerDelegate _delegate;
+
+ public ReloadingBehaviorTagHandlerDelegate(BehaviorHandler owner) {
+ applyOwner(owner);
+ }
+
+ private void applyOwner(BehaviorHandler owner) {
+ _owner = owner;
+ _delegate = new BehaviorTagHandlerDelegate(_owner);
+ }
+
+ @Override
+ public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+ if (WeavingContext.isDynamic(_owner.getClass())) {
+ BehaviorHandler newOwner = (BehaviorHandler) WeavingContext.getWeaver().reloadScriptingInstance(_owner, ScriptingConst.ARTIFACT_TYPE_BEHAVIOR_HANDLER);
+ if (!newOwner.getClass().equals(_owner.getClass())) {
+ applyOwner(newOwner);
+ }
+ }
+ _owner.apply(ctx, comp);
+ }
+
+ @Override
+ public MetaRuleset createMetaRuleset(Class type) {
+ return _delegate.createMetaRuleset(type);
+ }
+
+}
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingBehaviorTagHandlerDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingBehaviorTagHandlerDelegate.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingComponentTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingComponentTagHandlerDelegate.java?rev=921334&r1=921333&r2=921334&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingComponentTagHandlerDelegate.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingComponentTagHandlerDelegate.java Wed Mar 10 12:58:41 2010
@@ -1,5 +1,25 @@
+/*
+ * 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.scripting.facelet;
+import org.apache.myfaces.scripting.api.ScriptingConst;
import org.apache.myfaces.scripting.core.util.WeavingContext;
import org.apache.myfaces.scripting.facelet.support.ComponentRule;
import org.apache.myfaces.scripting.facelet.support.SwitchingMetarulesetImpl;
@@ -25,26 +45,29 @@ public class ReloadingComponentTagHandle
TagHandlerDelegate _delegate;
public ReloadingComponentTagHandlerDelegate(ComponentHandler owner) {
+ applyOwner(owner);
+ }
+
+ private void applyOwner(ComponentHandler owner) {
_owner = owner;
- _delegate = new ComponentTagHandlerDelegate(owner);
+ _delegate = new ComponentTagHandlerDelegate(_owner);
}
@Override
public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
- if (WeavingContext.isDynamic(comp.getClass())) {
- //TODO hook our own component code in here
+ if (WeavingContext.isDynamic(_owner.getClass())) {
+ ComponentHandler newOwner = (ComponentHandler) WeavingContext.getWeaver().reloadScriptingInstance(_owner, ScriptingConst.ARTIFACT_TYPE_COMPONENT_HANDLER);
+ if (!newOwner.getClass().equals(_owner.getClass())) {
+ applyOwner(newOwner);
+ }
}
- //if (comp.getClass().getName().contains("JavaTestComponent")) {
- // System.out.println("Debugpoint found");
- //}
-
_delegate.apply(ctx, comp);
}
public MetaRuleset createMetaRuleset(Class type) {
//We have to create a different meta rule set for dynamic classes
//which have weaver instantiation criteria, the original meta rule set
- //first applies the attributes and then calls BeanPropertyTagRule on our
+ //first applies the attributes and then calls BeanPropertyTagRule
//that one however caches the current method and does not take into consideration
//that classes can be changed on the fly
Added: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingConverterTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingConverterTagHandlerDelegate.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingConverterTagHandlerDelegate.java (added)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingConverterTagHandlerDelegate.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,65 @@
+/*
+ * 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.scripting.facelet;
+
+import org.apache.myfaces.scripting.api.ScriptingConst;
+import org.apache.myfaces.scripting.core.util.WeavingContext;
+import org.apache.myfaces.view.facelets.tag.jsf.ConverterTagHandlerDelegate;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.*;
+import java.io.IOException;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ReloadingConverterTagHandlerDelegate extends TagHandlerDelegate {
+
+ ConverterHandler _owner;
+ TagHandlerDelegate _delegate;
+
+ public ReloadingConverterTagHandlerDelegate(ConverterHandler owner) {
+ applyOwner(owner);
+ }
+
+ private void applyOwner(ConverterHandler owner) {
+ _owner = owner;
+ _delegate = new ConverterTagHandlerDelegate(_owner);
+ }
+
+ @Override
+ public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+ if (WeavingContext.isDynamic(_owner.getClass())) {
+ ConverterHandler newOwner = (ConverterHandler) WeavingContext.getWeaver().reloadScriptingInstance(_owner, ScriptingConst.ARTIFACT_TYPE_CONVERTER_HANDLER);
+ if(!newOwner.getClass().equals(_owner.getClass())) {
+ applyOwner(newOwner);
+ }
+ }
+ _delegate.apply(ctx, comp);
+ }
+
+ @Override
+ public MetaRuleset createMetaRuleset(Class type) {
+ return _delegate.createMetaRuleset(type);
+ }
+
+}
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingConverterTagHandlerDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingConverterTagHandlerDelegate.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingValidatorTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingValidatorTagHandlerDelegate.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingValidatorTagHandlerDelegate.java (added)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingValidatorTagHandlerDelegate.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,67 @@
+/*
+ * 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.scripting.facelet;
+
+import org.apache.myfaces.scripting.api.ScriptingConst;
+import org.apache.myfaces.scripting.core.util.WeavingContext;
+import org.apache.myfaces.view.facelets.tag.jsf.ValidatorTagHandlerDelegate;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRuleset;
+import javax.faces.view.facelets.TagHandlerDelegate;
+import javax.faces.view.facelets.ValidatorHandler;
+import java.io.IOException;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ReloadingValidatorTagHandlerDelegate extends TagHandlerDelegate {
+
+ ValidatorHandler _owner;
+ TagHandlerDelegate _delegate;
+
+ public ReloadingValidatorTagHandlerDelegate(ValidatorHandler owner) {
+ applyOwner(owner);
+ }
+
+ private void applyOwner(ValidatorHandler owner) {
+ _owner = owner;
+ _delegate = new ValidatorTagHandlerDelegate(_owner);
+ }
+
+ @Override
+ public void apply(FaceletContext ctx, UIComponent comp) throws IOException {
+ if (WeavingContext.isDynamic(_owner.getClass())) {
+ ValidatorHandler newOwner = (ValidatorHandler) WeavingContext.getWeaver().reloadScriptingInstance(_owner, ScriptingConst.ARTIFACT_TYPE_VALIDATOR_HANDLER);
+ if (!newOwner.getClass().equals(_owner.getClass())) {
+ applyOwner(newOwner);
+ }
+ }
+ _owner.apply(ctx, comp);
+ }
+
+ @Override
+ public MetaRuleset createMetaRuleset(Class type) {
+ return _delegate.createMetaRuleset(type);
+ }
+}
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingValidatorTagHandlerDelegate.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ReloadingValidatorTagHandlerDelegate.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/TagHandlerDelegateFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/TagHandlerDelegateFactoryImpl.java?rev=921334&r1=921333&r2=921334&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/TagHandlerDelegateFactoryImpl.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/TagHandlerDelegateFactoryImpl.java Wed Mar 10 12:58:41 2010
@@ -1,23 +1,46 @@
+/*
+ * 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.scripting.facelet;
+import org.apache.myfaces.scripting.core.util.WeavingContext;
import org.apache.myfaces.view.facelets.tag.jsf.BehaviorTagHandlerDelegate;
import org.apache.myfaces.view.facelets.tag.jsf.ComponentTagHandlerDelegate;
import org.apache.myfaces.view.facelets.tag.jsf.ConverterTagHandlerDelegate;
import org.apache.myfaces.view.facelets.tag.jsf.ValidatorTagHandlerDelegate;
-import javax.faces.view.facelets.BehaviorHandler;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.ConverterHandler;
-import javax.faces.view.facelets.TagHandlerDelegate;
-import javax.faces.view.facelets.TagHandlerDelegateFactory;
-import javax.faces.view.facelets.ValidatorHandler;
+import javax.faces.view.facelets.*;
+/**
+ * Tag handler delegate factory which injects reloading
+ * proxies for our facelet artifacts
+ */
public class TagHandlerDelegateFactoryImpl extends TagHandlerDelegateFactory {
@Override
public TagHandlerDelegate createBehaviorHandlerDelegate(
BehaviorHandler owner) {
- return new BehaviorTagHandlerDelegate(owner);
+ if (WeavingContext.isDynamic(owner.getClass())) {
+ return new ReloadingBehaviorTagHandlerDelegate(owner);
+ } else {
+ return new BehaviorTagHandlerDelegate(owner);
+ }
}
@Override
@@ -29,14 +52,21 @@ public class TagHandlerDelegateFactoryIm
@Override
public TagHandlerDelegate createConverterHandlerDelegate(
ConverterHandler owner) {
- return new ConverterTagHandlerDelegate(owner);
+ if (WeavingContext.isDynamic(owner.getClass())) {
+ return new ReloadingConverterTagHandlerDelegate(owner);
+ } else {
+ return new ConverterTagHandlerDelegate(owner);
+ }
}
@Override
public TagHandlerDelegate createValidatorHandlerDelegate(
ValidatorHandler owner) {
- return new ValidatorTagHandlerDelegate(owner);
+ if (WeavingContext.isDynamic(owner.getClass())) {
+ return new ReloadingValidatorTagHandlerDelegate(owner);
+ } else {
+ return new ValidatorTagHandlerDelegate(owner);
+ }
}
-
}
Added: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ValidatorHandlerReloadingStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ValidatorHandlerReloadingStrategy.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ValidatorHandlerReloadingStrategy.java (added)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ValidatorHandlerReloadingStrategy.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,60 @@
+/*
+ * 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.scripting.facelet;
+
+import org.apache.myfaces.scripting.api.ScriptingWeaver;
+import org.apache.myfaces.scripting.core.reloading.SimpleReloadingStrategy;
+import org.apache.myfaces.scripting.core.util.Cast;
+import org.apache.myfaces.scripting.core.util.ReflectUtil;
+
+import javax.faces.view.facelets.*;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class ValidatorHandlerReloadingStrategy extends SimpleReloadingStrategy {
+
+ public ValidatorHandlerReloadingStrategy(ScriptingWeaver weaver) {
+ super(weaver);
+ }
+
+ @Override
+ public Object reload(Object scriptingInstance, int artifactType) {
+ if (!(scriptingInstance instanceof ComponentHandler)) return scriptingInstance;
+ Class aclass = _weaver.reloadScriptingClass(scriptingInstance.getClass());
+ if (aclass.hashCode() == scriptingInstance.getClass().hashCode()) {
+ //class of this object has not changed although
+ // reload is enabled we can skip the rest now
+ return scriptingInstance;
+ }
+ ValidatorHandler oldHandler = (ValidatorHandler) scriptingInstance;
+ ValidatorConfig config = oldHandler.getValidatorConfig();
+ ValidatorHandler newHandler = (ValidatorHandler) ReflectUtil.instantiate(aclass, new Cast(ValidatorConfig.class, config));
+
+ //save all pending non config related properties wherever possible
+ super.mapProperties(newHandler, oldHandler);
+
+ return newHandler;
+ }
+
+}
+
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ValidatorHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/facelet/ValidatorHandlerReloadingStrategy.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml?rev=921334&r1=921333&r2=921334&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/facelets/groovy-taglib.xml Wed Mar 10 12:58:41 2010
@@ -1,6 +1,8 @@
-<?xml version="1.0"?>
-<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "facelet-taglib_1_0.dtd">
-<facelet-taglib version="2.0">
+<facelet-taglib xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd"
+ version="2.0">
<!-- author: werner.punz@irian.at -->
<namespace>http://myfaces.apache.org/groovy</namespace>
@@ -58,4 +60,14 @@
</converter>
</tag>
+
+ <tag>
+ <tag-name>tagHandlertest</tag-name>
+ <component>
+ <component-type>javax.faces.Input</component-type>
+ <renderer-type>javax.faces.Text</renderer-type>
+ <handler-class>org.apache.myfaces.javaloader.componentTest.MyComponentTag</handler-class>
+ </component>
+ </tag>
+
</facelet-taglib>
Added: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/MyComponentTag.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/MyComponentTag.java?rev=921334&view=auto
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/MyComponentTag.java (added)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/MyComponentTag.java Wed Mar 10 12:58:41 2010
@@ -0,0 +1,55 @@
+/*
+ * 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.javaloader.componentTest;
+
+import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import java.util.logging.Logger;
+
+/**
+ * @author Werner Punz (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class MyComponentTag extends ComponentHandler {
+
+ static Logger _log = Logger.getLogger(MyComponentTag.class.getName());
+
+ //note due to lio
+ public MyComponentTag() {
+ super(null);
+ }
+
+ public MyComponentTag(ComponentConfig config) {
+ super(config);
+ }
+
+ public void onComponentCreated(FaceletContext ctx, UIComponent c, UIComponent parent) {
+ _log.info("component create testing");
+ super.onComponentCreated(ctx, c, parent);
+ }
+
+ @Override
+ public void onComponentPopulated(FaceletContext ctx, UIComponent c, UIComponent parent) {
+ super.onComponentPopulated(ctx, c, parent);
+ }
+}
Propchange: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/MyComponentTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/componentTest/MyComponentTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml?rev=921334&r1=921333&r2=921334&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml (original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/componentTest.xhtml Wed Mar 10 12:58:41 2010
@@ -24,6 +24,8 @@
testAttr4="Attribute 4 set and showing"/>
</h:panelGroup>
+
+ <grv:tagHandlertest />
</h:form>
</div>
</ui:define>