You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2010/10/20 19:10:12 UTC
svn commit: r1025646 - in /myfaces/core/trunk/impl/src:
main/java/org/apache/myfaces/view/facelets/
main/java/org/apache/myfaces/view/facelets/impl/
test/java/org/apache/myfaces/view/facelets/tag/composite/
test/resources/org/apache/myfaces/view/facele...
Author: lu4242
Date: Wed Oct 20 17:10:12 2010
New Revision: 1025646
URL: http://svn.apache.org/viewvc?rev=1025646&view=rev
Log:
MYFACES-2946 composite:attribute "targets" property does not match with ViewDeclarationLanguage.retargetMethodExpressions
Added:
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentMethodExpressionTestCase.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/SimpleComponent.java
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeActionMethodInvocation.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeAttributeMethodExpressionTarget.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleActionMethodInvocation.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionEmpty.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionTarget.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/test-facelet.taglib.xml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeActionMethodInvocation.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeAttributeMethodExpressionTarget.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionEmpty.xhtml
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionTarget.xhtml
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentAttributeTestCase.java
myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpression.xhtml
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java?rev=1025646&r1=1025645&r2=1025646&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletCompositionContext.java Wed Oct 20 17:10:12 2010
@@ -18,8 +18,10 @@
*/
package org.apache.myfaces.view.facelets;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javax.faces.component.UIComponent;
import javax.faces.component.UniqueIdVendor;
@@ -284,4 +286,33 @@ abstract public class FaceletComposition
*/
public abstract void finalizeForDeletion(UIComponent component);
+ /**
+ * Add a method expression as targeted for the provided composite component
+ *
+ * @since 2.0.2
+ * @param compositeComponentParent
+ * @param attributeName
+ * @param backingValue A value that could be useful to revert its effects.
+ */
+ public abstract void addMethodExpressionTargeted(UIComponent compositeComponentParent, String attributeName, Object backingValue);
+
+ /**
+ * Get all method expressions targeted for the provided composite component
+ *
+ * @since 2.0.2
+ * @param compositeComponentParent
+ * @return
+ */
+ public abstract Map<String, Object> getMethodExpressionsTargeted(UIComponent compositeComponentParent);
+
+ /**
+ * Remove a method expression as targeted for the provided composite component
+ *
+ * @since 2.0.2
+ * @param compositeComponentParent
+ * @param attributeName
+ * @return A value that could be useful to revert its effects.
+ */
+ public abstract Object removeMethodExpressionTargeted(UIComponent compositeComponentParent, String attributeName);
+
}
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java?rev=1025646&r1=1025645&r2=1025646&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.java Wed Oct 20 17:10:12 2010
@@ -55,13 +55,16 @@ import javax.faces.context.ExternalConte
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
import javax.faces.event.MethodExpressionActionListener;
import javax.faces.event.MethodExpressionValueChangeListener;
import javax.faces.event.PhaseId;
import javax.faces.event.PreRemoveFromViewEvent;
import javax.faces.event.ValueChangeEvent;
+import javax.faces.event.ValueChangeListener;
import javax.faces.render.RenderKit;
import javax.faces.validator.MethodExpressionValidator;
+import javax.faces.validator.Validator;
import javax.faces.view.ActionSource2AttachedObjectHandler;
import javax.faces.view.ActionSource2AttachedObjectTarget;
import javax.faces.view.AttachedObjectHandler;
@@ -868,7 +871,9 @@ public class FaceletViewDeclarationLangu
String attributeExpressionString = attributeNameValueExpression.getExpressionString();
MethodExpression methodExpression = null;
MethodExpression methodExpression2 = null;
-
+
+ FaceletCompositionContext mctx = FaceletCompositionContext.getCurrentInstance();
+
if (isKnownMethod)
{
for (String target : targetsArray)
@@ -882,56 +887,117 @@ public class FaceletViewDeclarationLangu
continue;
}
+ Map<String, Object> methodsAlreadyProcessed = mctx.getMethodExpressionsTargeted(innerComponent);
+
if ("action".equals(attributeName))
{
- // target is ActionSource2
-
- methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
- createMethodExpression(elContext,
- attributeExpressionString, Object.class, EMPTY_CLASS_ARRAY), attributeNameValueExpression);
-
- ((ActionSource2)innerComponent).setActionExpression(methodExpression);
+ if (isCompositeComponentRetarget(context, innerComponent, attributeName) && !(innerComponent instanceof ActionSource2))
+ {
+ innerComponent.getAttributes().put(attributeName, attributeNameValueExpression);
+
+ mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
+
+ retargetMethodExpressions(context, innerComponent);
+ }
+ else if (!methodsAlreadyProcessed.containsKey(attributeName))
+ {
+ // target is ActionSource2
+ methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
+ createMethodExpression(elContext,
+ attributeExpressionString, Object.class, EMPTY_CLASS_ARRAY), attributeNameValueExpression);
+
+ ((ActionSource2)innerComponent).setActionExpression(methodExpression);
+ mctx.addMethodExpressionTargeted(topLevelComponent, attributeName, methodExpression);
+ }
}
else if ("actionListener".equals(attributeName))
{
- // target is ActionSource2
- methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
+ if (isCompositeComponentRetarget(context, innerComponent, attributeName) && !(innerComponent instanceof ActionSource2))
+ {
+ innerComponent.getAttributes().put(attributeName, attributeNameValueExpression);
+
+ ActionListener o = (ActionListener) mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
+ if (o != null)
+ {
+ ((ActionSource2)innerComponent).removeActionListener(o);
+ }
+
+ retargetMethodExpressions(context, innerComponent);
+ }
+ else if (!methodsAlreadyProcessed.containsKey(attributeName))
+ {
+ // target is ActionSource2
+ methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
+ createMethodExpression(elContext,
+ attributeExpressionString, Void.TYPE, ACTION_LISTENER_SIGNATURE), attributeNameValueExpression);
+
+ methodExpression2 = reWrapMethodExpression(context.getApplication().getExpressionFactory().
createMethodExpression(elContext,
- attributeExpressionString, Void.TYPE, ACTION_LISTENER_SIGNATURE), attributeNameValueExpression);
-
- methodExpression2 = reWrapMethodExpression(context.getApplication().getExpressionFactory().
- createMethodExpression(elContext,
- attributeExpressionString, Void.TYPE, EMPTY_CLASS_ARRAY), attributeNameValueExpression);
-
- ((ActionSource2)innerComponent).addActionListener(
- new MethodExpressionActionListener(methodExpression, methodExpression2));
+ attributeExpressionString, Void.TYPE, EMPTY_CLASS_ARRAY), attributeNameValueExpression);
+
+ ActionListener actionListener = new MethodExpressionActionListener(methodExpression, methodExpression2);
+ ((ActionSource2)innerComponent).addActionListener(actionListener);
+ mctx.addMethodExpressionTargeted(topLevelComponent, attributeName, actionListener);
+ }
}
else if ("validator".equals(attributeName))
{
- // target is EditableValueHolder
- methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
- createMethodExpression(elContext,
- attributeExpressionString, Void.TYPE,
- VALIDATOR_SIGNATURE), attributeNameValueExpression);
-
- ((EditableValueHolder)innerComponent).addValidator(
- new MethodExpressionValidator(methodExpression));
+ if (isCompositeComponentRetarget(context, innerComponent, attributeName) && !(innerComponent instanceof EditableValueHolder))
+ {
+ innerComponent.getAttributes().put(attributeName, attributeNameValueExpression);
+
+ Validator o = (Validator) mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
+ if (o != null)
+ {
+ ((EditableValueHolder)innerComponent).removeValidator(o);
+ }
+
+ retargetMethodExpressions(context, innerComponent);
+ }
+ else if (!methodsAlreadyProcessed.containsKey(attributeName))
+ {
+ // target is EditableValueHolder
+ methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
+ createMethodExpression(elContext,
+ attributeExpressionString, Void.TYPE,
+ VALIDATOR_SIGNATURE), attributeNameValueExpression);
+
+ Validator validator = new MethodExpressionValidator(methodExpression);
+ ((EditableValueHolder)innerComponent).addValidator( validator );
+ mctx.addMethodExpressionTargeted(topLevelComponent, attributeName, validator);
+ }
}
else if ("valueChangeListener".equals(attributeName))
{
- // target is EditableValueHolder
- methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
- createMethodExpression(elContext,
- attributeExpressionString, Void.TYPE,
- VALUE_CHANGE_LISTENER_SIGNATURE), attributeNameValueExpression);
-
- methodExpression2 = reWrapMethodExpression(context.getApplication().getExpressionFactory().
- createMethodExpression(elContext,
- attributeExpressionString, Void.TYPE,
- EMPTY_CLASS_ARRAY), attributeNameValueExpression);
+ if (isCompositeComponentRetarget(context, innerComponent, attributeName) && !(innerComponent instanceof EditableValueHolder))
+ {
+ innerComponent.getAttributes().put(attributeName, attributeNameValueExpression);
- ((EditableValueHolder)innerComponent).addValueChangeListener(
- new MethodExpressionValueChangeListener(methodExpression, methodExpression2));
+ ValueChangeListener o = (ValueChangeListener) mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
+ if (o != null)
+ {
+ ((EditableValueHolder)innerComponent).removeValueChangeListener(o);
+ }
+
+ retargetMethodExpressions(context, innerComponent);
+ }
+ else if (!methodsAlreadyProcessed.containsKey(attributeName))
+ {
+ // target is EditableValueHolder
+ methodExpression = reWrapMethodExpression(context.getApplication().getExpressionFactory().
+ createMethodExpression(elContext,
+ attributeExpressionString, Void.TYPE,
+ VALUE_CHANGE_LISTENER_SIGNATURE), attributeNameValueExpression);
+
+ methodExpression2 = reWrapMethodExpression(context.getApplication().getExpressionFactory().
+ createMethodExpression(elContext,
+ attributeExpressionString, Void.TYPE,
+ EMPTY_CLASS_ARRAY), attributeNameValueExpression);
+
+ ValueChangeListener valueChangeListener = new MethodExpressionValueChangeListener(methodExpression, methodExpression2);
+ ((EditableValueHolder)innerComponent).addValueChangeListener( valueChangeListener );
+ mctx.addMethodExpressionTargeted(topLevelComponent, attributeName, valueChangeListener);
+ }
}
}
}
@@ -940,6 +1006,9 @@ public class FaceletViewDeclarationLangu
// composite:attribute targets property only has sense for action, actionListener,
// validator or valueChangeListener. This means we have to retarget the method expression
// to the topLevelComponent.
+
+ // Since a MethodExpression has no state, we can use it multiple times without problem, so
+ // first create it here.
methodSignature = methodSignature.trim();
methodExpression = context.getApplication().getExpressionFactory().
createMethodExpression(elContext,
@@ -947,8 +1016,36 @@ public class FaceletViewDeclarationLangu
_getParameters(methodSignature));
methodExpression = reWrapMethodExpression(methodExpression, attributeNameValueExpression);
-
+
+ for (String target : targetsArray)
+ {
+ UIComponent innerComponent = topLevelComponent.findComponent(target);
+
+ if (innerComponent == null)
+ {
+ continue;
+ }
+
+ // If a component is found, that means the expression should be retarget to the
+ // components related
+ if (isCompositeComponentRetarget(context, innerComponent, attributeName))
+ {
+ innerComponent.getAttributes().put(attributeName, attributeNameValueExpression);
+
+ mctx.removeMethodExpressionTargeted(innerComponent, attributeName);
+
+ retargetMethodExpressions(context, innerComponent);
+ }
+ else
+ {
+ //Put the retarget
+ innerComponent.getAttributes().put(attributeName, methodExpression);
+ }
+ }
+
+ //Store the method expression to the topLevelComponent to allow reference it through EL
topLevelComponent.getAttributes().put(attributeName, methodExpression);
+ mctx.addMethodExpressionTargeted(topLevelComponent, attributeName, methodExpression);
}
// We need to remove the previous ValueExpression, to prevent some possible
@@ -957,6 +1054,57 @@ public class FaceletViewDeclarationLangu
}
}
}
+
+ private boolean isCompositeComponentRetarget(FacesContext context, UIComponent component, String attributeName)
+ {
+ if (UIComponent.isCompositeComponent(component))
+ {
+ BeanInfo compositeComponentMetadata = (BeanInfo) component.getAttributes().get(UIComponent.BEANINFO_KEY);
+
+ PropertyDescriptor[] propertyDescriptors = compositeComponentMetadata.getPropertyDescriptors();
+
+ ELContext elContext = (ELContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
+
+ for (PropertyDescriptor propertyDescriptor : propertyDescriptors)
+ {
+ if (propertyDescriptor.getValue("type") != null)
+ {
+ // This check is necessary if we have both "type" and "method-signature" set.
+ // In that case, "method-signature" is ignored
+ continue;
+ }
+
+ if (attributeName.equals(propertyDescriptor.getName()))
+ {
+ boolean isKnownMethod = "action".equals(attributeName) || "actionListener".equals(attributeName)
+ || "validator".equals(attributeName) || "valueChangeListener".equals(attributeName);
+
+ // <composite:attribute> method-signature attribute is
+ // ValueExpression that must evaluate to String
+ ValueExpression methodSignatureExpression
+ = (ValueExpression) propertyDescriptor.getValue("method-signature");
+ String methodSignature = null;
+ if (methodSignatureExpression != null)
+ {
+ // Check if the value expression holds a method signature
+ // Note that it could be null, so in that case we don't have to do anything
+ methodSignature = (String) methodSignatureExpression.getValue(elContext);
+ }
+
+ // either the attributeName has to be a knownMethod or there has to be a method-signature
+ if (isKnownMethod || methodSignature != null)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ else
+ {
+ return false;
+ }
+ }
@SuppressWarnings("unchecked")
private MethodExpression reWrapMethodExpression(MethodExpression createdMethodExpression, ValueExpression originalValueExpression)
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java?rev=1025646&r1=1025645&r2=1025646&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/impl/FaceletCompositionContextImpl.java Wed Oct 20 17:10:12 2010
@@ -19,6 +19,8 @@
package org.apache.myfaces.view.facelets.impl;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -69,6 +71,8 @@ public class FaceletCompositionContextIm
private int _deletionLevel;
private final Map<UIComponent, List<AttachedObjectHandler>> _attachedObjectHandlers;
+
+ private final Map<UIComponent, Map<String, Object> > _methodExpressionsTargeted;
private static final String VIEWROOT_FACELET_ID = "oam.VIEW_ROOT";
@@ -79,6 +83,7 @@ public class FaceletCompositionContextIm
_facesContext = facesContext;
_attachedObjectHandlers = new HashMap<UIComponent, List<AttachedObjectHandler>>();
_componentsMarkedForDeletion = new ArrayList<Map<String,UIComponent>>();
+ _methodExpressionsTargeted = new HashMap<UIComponent, Map<String, Object>>();
_deletionLevel = -1;
}
@@ -365,6 +370,42 @@ public class FaceletCompositionContextIm
{
return _attachedObjectHandlers.get(compositeComponentParent);
}
+
+ @Override
+ public void addMethodExpressionTargeted(UIComponent compositeComponentParent, String attributeName, Object backingValue)
+ {
+ Map<String, Object> map = _methodExpressionsTargeted.get(compositeComponentParent);
+
+ if (map == null)
+ {
+ map = new HashMap<String, Object>(8);
+ _methodExpressionsTargeted.put(compositeComponentParent, map);
+ }
+
+ map.put(attributeName, backingValue);
+ }
+
+ @Override
+ public Map<String, Object> getMethodExpressionsTargeted(UIComponent compositeComponentParent)
+ {
+ Map<String, Object> map = _methodExpressionsTargeted.get(compositeComponentParent);
+ if (map == null)
+ {
+ map = Collections.emptyMap();
+ }
+ return map;
+ }
+
+ @Override
+ public Object removeMethodExpressionTargeted(UIComponent compositeComponentParent, String attributeName)
+ {
+ Map<String, Object> map = _methodExpressionsTargeted.get(compositeComponentParent);
+ if (map != null)
+ {
+ return map.remove(attributeName);
+ }
+ return null;
+ }
/**
* Add a level of components marked for deletion.
Modified: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentAttributeTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentAttributeTestCase.java?rev=1025646&r1=1025645&r2=1025646&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentAttributeTestCase.java (original)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentAttributeTestCase.java Wed Oct 20 17:10:12 2010
@@ -23,7 +23,6 @@ import java.beans.BeanDescriptor;
import java.beans.FeatureDescriptor;
import java.beans.PropertyDescriptor;
import java.io.StringWriter;
-import java.lang.reflect.Field;
import java.util.Map;
import javax.el.MethodExpression;
@@ -45,6 +44,7 @@ import org.apache.myfaces.test.utils.Htm
import org.apache.myfaces.test.utils.HtmlRenderedAttr;
import org.apache.myfaces.view.facelets.FaceletTestCase;
import org.apache.myfaces.view.facelets.bean.DummyBean;
+import org.apache.myfaces.view.facelets.bean.HelloWorld;
import org.junit.Assert;
import org.junit.Test;
@@ -260,6 +260,41 @@ public class CompositeComponentAttribute
String resp = sw.toString();
}
+ @Test
+ public void testCompositeActionMethodInvocation() throws Exception
+ {
+ HelloWorld helloWorld = new HelloWorld();
+
+ facesContext.getExternalContext().getRequestMap().put("helloWorldBean",
+ helloWorld);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testCompositeActionMethodInvocation.xhtml");
+
+ UIComponent form = root.findComponent("testForm1");
+ Assert.assertNotNull(form);
+ UINamingContainer compositeComponent = (UINamingContainer) form.getChildren().get(0);
+ Assert.assertNotNull(compositeComponent);
+ UINamingContainer compositeComponent2 = (UINamingContainer) compositeComponent.findComponent("button1");
+ Assert.assertNotNull(compositeComponent2);
+ UICommand button = (UICommand) compositeComponent2.findComponent("button2");
+ Assert.assertNotNull(button);
+
+ Assert.assertNotNull(button.getActionExpression());
+
+ Assert.assertEquals("success", button.getActionExpression().invoke(facesContext.getELContext(), null));
+
+ Assert.assertEquals(1, button.getActionListeners().length);
+
+ //StringWriter sw = new StringWriter();
+ //MockResponseWriter mrw = new MockResponseWriter(sw);
+ //facesContext.setResponseWriter(mrw);
+
+ //root.encodeAll(facesContext);
+ //sw.flush();
+ //System.out.print(sw.toString());
+ }
+
/**
* Tests if unspecified attributes on <composite:interface>, <composite:attribute>
* and <composite:facet> are handled correctly.
Added: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentMethodExpressionTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentMethodExpressionTestCase.java?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentMethodExpressionTestCase.java (added)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/CompositeComponentMethodExpressionTestCase.java Wed Oct 20 17:10:12 2010
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UINamingContainer;
+import javax.faces.component.UIViewRoot;
+
+import org.apache.myfaces.view.facelets.FaceletTestCase;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CompositeComponentMethodExpressionTestCase extends FaceletTestCase
+{
+ @Override
+ protected void setupComponents() throws Exception
+ {
+ super.setupComponents();
+ application.addComponent(CompositeTestComponent.class.getName(),
+ CompositeTestComponent.class.getName());
+ application.addComponent(SimpleComponent.class.getName(), SimpleComponent.class.getName());
+ }
+
+ @Override
+ protected void setUpServletObjects() throws Exception
+ {
+ super.setUpServletObjects();
+ servletContext.addInitParameter("javax.faces.FACELETS_LIBRARIES", "/test-facelet.taglib.xml");
+ }
+
+ @Test
+ public void testSimpleMethodExpressionTarget() throws Exception
+ {
+ MockAttributeBean bean = new MockAttributeBean();
+
+ facesContext.getExternalContext().getRequestMap().put("bean",
+ bean);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testSimpleAttributeMethodExpressionTarget.xhtml");
+
+
+ UIComponent panelGroup1 = root.findComponent("testGroup1");
+ Assert.assertNotNull(panelGroup1);
+ UINamingContainer compositeComponent = (UINamingContainer) panelGroup1.getChildren().get(0);
+ Assert.assertNotNull(compositeComponent);
+ SimpleComponent testComponent = (SimpleComponent) compositeComponent.findComponent("testComponent");
+ Assert.assertNotNull(testComponent);
+ Assert.assertNotNull(testComponent.getCustomMethod());
+ Assert.assertEquals("somethingFunny"+"x", testComponent.getCustomMethod().invoke(facesContext.getELContext(), new Object[]{"x"}));
+ }
+
+ @Test
+ public void testCompositeMethodExpressionTarget() throws Exception
+ {
+ MockAttributeBean bean = new MockAttributeBean();
+
+ facesContext.getExternalContext().getRequestMap().put("bean",
+ bean);
+
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testCompositeAttributeMethodExpressionTarget.xhtml");
+
+
+ UIComponent panelGroup1 = root.findComponent("testGroup1");
+ Assert.assertNotNull(panelGroup1);
+ UINamingContainer compositeComponent = (UINamingContainer) panelGroup1.getChildren().get(0);
+ Assert.assertNotNull(compositeComponent);
+ UINamingContainer compositeComponent2 = (UINamingContainer) compositeComponent.findComponent("simpleAttributeMethodExpressionTarget");
+ Assert.assertNotNull(compositeComponent2);
+ SimpleComponent testComponent = (SimpleComponent) compositeComponent2.findComponent("testComponent");
+ Assert.assertNotNull(testComponent);
+ Assert.assertNotNull(testComponent.getCustomMethod());
+ Assert.assertEquals("somethingFunny"+"x", testComponent.getCustomMethod().invoke(facesContext.getELContext(), new Object[]{"x"}));
+ }
+
+}
Added: myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/SimpleComponent.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/SimpleComponent.java?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/SimpleComponent.java (added)
+++ myfaces/core/trunk/impl/src/test/java/org/apache/myfaces/view/facelets/tag/composite/SimpleComponent.java Wed Oct 20 17:10:12 2010
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.view.facelets.tag.composite;
+
+import javax.el.MethodExpression;
+import javax.faces.component.UINamingContainer;
+
+public class SimpleComponent extends UINamingContainer
+{
+
+ public SimpleComponent()
+ {
+ super();
+ }
+
+ public String getJavaProperty()
+ {
+ return (String) getStateHelper().eval(PropertyKeys.javaProperty);
+ }
+
+ public void setJavaProperty(String javaProperty)
+ {
+ getStateHelper().put(PropertyKeys.javaProperty, javaProperty);
+ }
+
+ public MethodExpression getCustomMethod()
+ {
+ return (MethodExpression) getStateHelper().eval(PropertyKeys.customMethod);
+ }
+
+ public void setCustomMethod(MethodExpression customMethodExpression)
+ {
+ getStateHelper().put(PropertyKeys.customMethod, customMethodExpression);
+ }
+
+ protected enum PropertyKeys
+ {
+ javaProperty,
+ customMethod
+ }
+}
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeActionMethodInvocation.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeActionMethodInvocation.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeActionMethodInvocation.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeActionMethodInvocation.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,34 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:attribute name="value"/>
+ <composite:attribute name="action" targets="button1"/>
+ <composite:attribute name="actionListener" targets="button1"/>
+</composite:interface>
+<composite:implementation>
+ <testComposite:simpleActionMethodInvocation id="button1" value="#{cc.attrs.value}" action="nothing"/>
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeAttributeMethodExpressionTarget.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeAttributeMethodExpressionTarget.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeAttributeMethodExpressionTarget.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/compositeAttributeMethodExpressionTarget.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,33 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:tc="http://myfaces.apache.org/testComponent"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:attribute name="customMethod" method-signature="String doSomething(String)" targets="simpleAttributeMethodExpressionTarget"/>
+</composite:interface>
+<composite:implementation>
+ <testComposite:simpleAttributeMethodExpressionTarget id="simpleAttributeMethodExpressionTarget"/>
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleActionMethodInvocation.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleActionMethodInvocation.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleActionMethodInvocation.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleActionMethodInvocation.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,34 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:attribute name="value"/>
+ <composite:attribute name="action" targets="button2"/>
+ <composite:attribute name="actionListener" targets="button2"/>
+</composite:interface>
+<composite:implementation>
+ <h:commandButton id="button2" value="#{cc.attrs.value}"/>
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Modified: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpression.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpression.xhtml?rev=1025646&r1=1025645&r2=1025646&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpression.xhtml (original)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpression.xhtml Wed Oct 20 17:10:12 2010
@@ -27,7 +27,7 @@
<composite:attribute name="validator" targets="input" method-signature="void validateSomething(javax.faces.context.FacesContext,javax.faces.component.UIComponent,Object)"/>
<composite:attribute name="valueChangeListener" targets="input" method-signature="void afterSomeChange(javax.faces.event.ValueChangeEvent)"/>
<!-- Here targets should be ignored, because it is only valid for the previous four attributes -->
- <composite:attribute name="metodo" targets="button" method-signature="String someAction()"/>
+ <composite:attribute name="metodo" method-signature="String someAction()"/>
</composite:interface>
<composite:implementation>
<h:commandButton id="button" action="#{cc.attrs.action}" value="Press Me" />
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionEmpty.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionEmpty.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionEmpty.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionEmpty.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,32 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:tc="http://myfaces.apache.org/testComponent">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:attribute name="customMethod" method-signature="String doSomething(String)"/>
+</composite:interface>
+<composite:implementation>
+ <tc:testComponent id="testComponent" customMethod="#{cc.attrs.customMethod}"/>
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionTarget.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionTarget.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionTarget.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/resources/testComposite/simpleAttributeMethodExpressionTarget.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,32 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:composite="http://java.sun.com/jsf/composite"
+ xmlns:tc="http://myfaces.apache.org/testComponent">
+<head>
+</head>
+<body>
+<composite:interface>
+ <composite:attribute name="customMethod" method-signature="String doSomething(String)" targets="testComponent"/>
+</composite:interface>
+<composite:implementation>
+ <tc:testComponent id="testComponent"/>
+</composite:implementation>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/test-facelet.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/test-facelet.taglib.xml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/test-facelet.taglib.xml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/test-facelet.taglib.xml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * 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.
+-->
+<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">
+
+ <namespace>http://myfaces.apache.org/testComponent</namespace>
+
+ <tag>
+ <tag-name>testComponent</tag-name>
+ <component>
+ <component-type>org.apache.myfaces.view.facelets.tag.composite.SimpleComponent</component-type>
+ </component>
+ </tag>
+
+</facelet-taglib>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeActionMethodInvocation.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeActionMethodInvocation.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeActionMethodInvocation.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeActionMethodInvocation.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,28 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:form id="testForm1">
+ <testComposite:compositeActionMethodInvocation id="compositeActionMethodInvocation" action="#{helloWorldBean.send}" actionListener="#{helloWorldBean.actionListener}" />
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeAttributeMethodExpressionTarget.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeAttributeMethodExpressionTarget.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeAttributeMethodExpressionTarget.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testCompositeAttributeMethodExpressionTarget.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,29 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:panelGroup id="testGroup1">
+<testComposite:compositeAttributeMethodExpressionTarget customMethod="#{bean.doSomethingFunny}">
+</testComposite:compositeAttributeMethodExpressionTarget>
+</h:panelGroup>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionEmpty.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionEmpty.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionEmpty.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionEmpty.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,29 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:panelGroup id="testGroup1">
+<testComposite:simpleAttributeMethodExpressionEmpty customMethod="#{bean.doSomethingFunny}">
+</testComposite:simpleAttributeMethodExpressionEmpty>
+</h:panelGroup>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionTarget.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionTarget.xhtml?rev=1025646&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionTarget.xhtml (added)
+++ myfaces/core/trunk/impl/src/test/resources/org/apache/myfaces/view/facelets/tag/composite/testSimpleAttributeMethodExpressionTarget.xhtml Wed Oct 20 17:10:12 2010
@@ -0,0 +1,29 @@
+<!--
+ Licensed 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.
+
+ $Id: defineInclude.xml 804043 2009-08-13 22:08:44Z lu4242 $
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:testComposite="http://java.sun.com/jsf/composite/testComposite">
+<head>
+</head>
+<body>
+<h:panelGroup id="testGroup1">
+<testComposite:simpleAttributeMethodExpressionTarget customMethod="#{bean.doSomethingFunny}">
+</testComposite:simpleAttributeMethodExpressionTarget>
+</h:panelGroup>
+</body>
+</html>
\ No newline at end of file