dev@javaserverfaces.java.net

Seeking Review: 2925 binding and composite components

From: Edward Burns <edward.burns_at_oracle.com>
Date: Tue, 16 Jul 2013 14:52:20 -0700

https://java.net/jira/browse/JAVASERVERFACES-2925

http://java.net/jira/browse/JAVASERVERFACES-2925 ensure composite components with binding attribute work as expected

SECTION: Modified Files
----------------------------
M jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/CompositeComponentTagHandler.java

- in createComponent(), ensure the setter of the ValueExpression is called.

M test/pom.xml
M test/agnostic/facelets/pom.xml
A test/agnostic/facelets/binding
A test/agnostic/facelets/binding/nbactions.xml
A test/agnostic/facelets/binding/src
A test/agnostic/facelets/binding/src/test
A test/agnostic/facelets/binding/src/test/java
A test/agnostic/facelets/binding/src/test/java/com
A test/agnostic/facelets/binding/src/test/java/com/sun
A test/agnostic/facelets/binding/src/test/java/com/sun/faces
A test/agnostic/facelets/binding/src/test/java/com/sun/faces/test
A test/agnostic/facelets/binding/src/test/java/com/sun/faces/test/agnostic
A test/agnostic/facelets/binding/src/test/java/com/sun/faces/test/agnostic/facelets
A test/agnostic/facelets/binding/src/test/java/com/sun/faces/test/agnostic/facelets/binding
A test/agnostic/facelets/binding/src/test/java/com/sun/faces/test/agnostic/facelets/binding/AutomatedTestIT.java
A test/agnostic/facelets/binding/src/main
A test/agnostic/facelets/binding/src/main/java
A test/agnostic/facelets/binding/src/main/java/com
A test/agnostic/facelets/binding/src/main/java/com/sun
A test/agnostic/facelets/binding/src/main/java/com/sun/faces
A test/agnostic/facelets/binding/src/main/java/com/sun/faces/test
A test/agnostic/facelets/binding/src/main/java/com/sun/faces/test/agnostic
A test/agnostic/facelets/binding/src/main/java/com/sun/faces/test/agnostic/facelets
A test/agnostic/facelets/binding/src/main/java/com/sun/faces/test/agnostic/facelets/binding
A test/agnostic/facelets/binding/src/main/java/com/sun/faces/test/agnostic/facelets/binding/UserBean.java
A test/agnostic/facelets/binding/src/main/resources
A test/agnostic/facelets/binding/src/main/webapp
A test/agnostic/facelets/binding/src/main/webapp/index.xhtml
A test/agnostic/facelets/binding/src/main/webapp/WEB-INF
A test/agnostic/facelets/binding/src/main/webapp/WEB-INF/test.taglib.xml
A test/agnostic/facelets/binding/src/main/webapp/WEB-INF/beans.xml
A test/agnostic/facelets/binding/src/main/webapp/WEB-INF/web.xml
A test/agnostic/facelets/binding/src/main/webapp/WEB-INF/glassfish-web.xml
A test/agnostic/facelets/binding/src/main/webapp/resources
A test/agnostic/facelets/binding/src/main/webapp/resources/components
A test/agnostic/facelets/binding/src/main/webapp/resources/components/bind.xhtml
A test/agnostic/facelets/binding/src/main/webapp/composite.xhtml
A test/agnostic/facelets/binding/pom.xml

- Test in progress.


SECTION: Diffs
----------------------------
Index: jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/CompositeComponentTagHandler.java
===================================================================
--- jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/CompositeComponentTagHandler.java (revision 12110)
+++ jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/CompositeComponentTagHandler.java (working copy)
@@ -58,11 +58,8 @@
 
 package com.sun.faces.facelets.tag.jsf;
 
-import com.sun.faces.application.ApplicationAssociate;
-import javax.faces.view.facelets.Facelet;
 import com.sun.faces.facelets.util.ReflectionUtil;
 import com.sun.faces.facelets.el.VariableMapperWrapper;
-import com.sun.faces.facelets.impl.DefaultFaceletFactory;
 import com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.CreateComponentDelegate;
 import com.sun.faces.facelets.tag.MetaRulesetImpl;
 import com.sun.faces.facelets.tag.MetadataTargetImpl;
@@ -156,6 +153,7 @@
             }
             if (cc == null) {
                 cc = context.getApplication().createComponent(context, ccResource);
+ cc.setValueExpression("binding", ve);
                 ve.setValue(ctx, cc);
             }
         } else {
Index: test/pom.xml
===================================================================
--- test/pom.xml (revision 12110)
+++ test/pom.xml (working copy)
@@ -10,6 +10,7 @@
     <packaging>pom</packaging>
     <name>Mojarra ${project.version} - Test</name>
     <modules>
+ <module>util</module>
         <module>agnostic</module>
         <module>cluster</module>
         <module>glassfish</module>
@@ -18,7 +19,6 @@
         <module>selenium</module>
         <module>servlet31</module>
         <module>unit</module>
- <module>util</module>
         <module>virtual</module>
         <module>weblogic12c</module>
         <module>web-profile</module>
Index: test/agnostic/facelets/pom.xml
===================================================================
--- test/agnostic/facelets/pom.xml (revision 12110)
+++ test/agnostic/facelets/pom.xml (working copy)
@@ -1,66 +1,64 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
-
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License"). You
- may not use this file except in compliance with the License. You can
- obtain a copy of the License at
- https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- or packager/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
-
- When distributing the software, include this License Header Notice in each
- file and include the License file at packager/legal/LICENSE.txt.
-
- GPL Classpath Exception:
- Oracle designates this particular file as subject to the "Classpath"
- exception as provided by Oracle in the GPL Version 2 section of the License
- file that accompanied this code.
-
- Modifications:
- If applicable, add the following below the License Header, with the fields
- enclosed by brackets [] replaced by your own identifying information:
- "Portions Copyright [year] [name of copyright owner]"
-
- Contributor(s):
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
-
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>com.sun.faces.test.agnostic</groupId>
- <artifactId>pom</artifactId>
- <version>2.2.2-SNAPSHOT</version>
- </parent>
- <groupId>com.sun.faces.test.agnostic.facelets</groupId>
- <artifactId>pom</artifactId>
- <packaging>pom</packaging>
- <name>Mojarra ${project.version} - Test - Agnostic - Facelets</name>
- <modules>
- <module>c</module>
- <module>cc</module>
- <module>ccInJar</module>
- <module>core</module>
- <module>coreEmptyAsNull</module>
- <module>html</module>
- <module>ui</module>
- <module>viewAction</module>
- </modules>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.sun.faces.test.agnostic</groupId>
+ <artifactId>pom</artifactId>
+ <version>2.2.2-SNAPSHOT</version>
+ </parent>
+ <groupId>com.sun.faces.test.agnostic.facelets</groupId>
+ <artifactId>pom</artifactId>
+ <packaging>pom</packaging>
+ <name>Mojarra ${project.version} - Test - Agnostic - Facelets</name>
+ <modules>
+ <module>c</module>
+ <module>cc</module>
+ <module>ccInJar</module>
+ <module>core</module>
+ <module>coreEmptyAsNull</module>
+ <module>html</module>
+ <module>ui</module>
+ <module>viewAction</module>
+ <module>binding</module>
+ </modules>
+</project>
Index: test/agnostic/facelets/binding/nbactions.xml
===================================================================
--- test/agnostic/facelets/binding/nbactions.xml (revision 0)
+++ test/agnostic/facelets/binding/nbactions.xml (revision 0)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+--><actions>
+ <action>
+ <actionName>debug.test.single</actionName>
+ <goals>
+ <goal>test-compile</goal>
+ <goal>surefire:test</goal>
+ </goals>
+ <properties>
+ <test>binding</test>
+ <forkMode>once</forkMode>
+ <maven.surefire.debug>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address}</maven.surefire.debug>
+ <webapp.enableClientStateDebugging>true</webapp.enableClientStateDebugging>
+ <jpda.listen>true</jpda.listen>
+ <project.build.finalName>test-agnostic-facelets-binding</project.build.finalName>
+ <webapp.projectStage>Development</webapp.projectStage>
+ <webapp.stateSavingMethod>client</webapp.stateSavingMethod>
+ <integration.serverPort>8080</integration.serverPort>
+ <integration.serverName>localhost</integration.serverName>
+ <integration.url>http://localhost:8080/test-agnostic-facelets-binding/</integration.url>
+ <webapp.partialStateSaving>false</webapp.partialStateSaving>
+ </properties>
+ </action>
+ <action>
+ <actionName>test.single</actionName>
+ <goals>
+ <goal>test-compile</goal>
+ <goal>surefire:test</goal>
+ </goals>
+ <properties>
+ <project.build.finalName>test-agnostic-facelets-binding</project.build.finalName>
+ <integration.serverPort>8080</integration.serverPort>
+ <integration.serverName>localhost</integration.serverName>
+ <integration.url>http://localhost:8080/test-agnostic-facelets-binding/</integration.url>
+ <test>binding</test>
+ </properties>
+ </action>
+ <action>
+ <actionName>build</actionName>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ <properties>
+ <webapp.projectStage>Development</webapp.projectStage>
+ <webapp.partialStateSaving>false</webapp.partialStateSaving>
+ <webapp.enableClientStateDebugging>true</webapp.enableClientStateDebugging>
+ <webapp.stateSavingMethod>client</webapp.stateSavingMethod>
+ </properties>
+ </action>
+ <action>
+ <actionName>rebuild</actionName>
+ <goals>
+ <goal>clean</goal>
+ <goal>install</goal>
+ </goals>
+ <properties>
+
+ <webapp.partialStateSaving>false</webapp.partialStateSaving>
+
+ <webapp.projectStage>Development</webapp.projectStage>
+
+ <webapp.enableClientStateDebugging>true</webapp.enableClientStateDebugging>
+
+ <webapp.stateSavingMethod>client</webapp.stateSavingMethod>
+
+ </properties>
+ </action>
+ <action>
+ <actionName>build-with-dependencies</actionName>
+ <reactor>also-make</reactor>
+ <goals>
+ <goal>install</goal>
+ </goals>
+ <properties>
+ <webapp.partialStateSaving>false</webapp.partialStateSaving>
+ <webapp.stateSavingMethod>client</webapp.stateSavingMethod>
+ <webapp.enableClientStateDebugging>true</webapp.enableClientStateDebugging>
+ <webapp.projectStage>Development</webapp.projectStage>
+ </properties>
+ </action>
+ <action>
+ <actionName>run</actionName>
+ <goals>
+ <goal>package</goal>
+ </goals>
+ <properties>
+ <webapp.partialStateSaving>false</webapp.partialStateSaving>
+ <netbeans.deploy>true</netbeans.deploy>
+ <webapp.enableClientStateDebugging>true</webapp.enableClientStateDebugging>
+ <webapp.stateSavingMethod>client</webapp.stateSavingMethod>
+ <webapp.projectStage>Development</webapp.projectStage>
+ </properties>
+ </action>
+ <action>
+ <actionName>run.single.deploy</actionName>
+ <goals>
+ <goal>package</goal>
+ </goals>
+ <properties>
+ <webapp.partialStateSaving>false</webapp.partialStateSaving>
+ <netbeans.deploy>true</netbeans.deploy>
+ <webapp.enableClientStateDebugging>true</webapp.enableClientStateDebugging>
+ <netbeans.deploy.clientUrlPart>${webpagePath}</netbeans.deploy.clientUrlPart>
+ <webapp.stateSavingMethod>client</webapp.stateSavingMethod>
+ <webapp.projectStage>Development</webapp.projectStage>
+ </properties>
+ </action>
+ <action>
+ <actionName>debug.single.deploy</actionName>
+ <goals>
+ <goal>package</goal>
+ </goals>
+ <properties>
+ <webapp.partialStateSaving>false</webapp.partialStateSaving>
+ <netbeans.deploy>true</netbeans.deploy>
+ <webapp.enableClientStateDebugging>true</webapp.enableClientStateDebugging>
+ <netbeans.deploy.debugmode>true</netbeans.deploy.debugmode>
+ <netbeans.deploy.clientUrlPart>${webpagePath}</netbeans.deploy.clientUrlPart>
+ <webapp.stateSavingMethod>client</webapp.stateSavingMethod>
+ <webapp.projectStage>Development</webapp.projectStage>
+ </properties>
+ </action>
+ </actions>
Index: test/agnostic/facelets/binding/src/test/java/com/sun/faces/test/agnostic/facelets/binding/AutomatedTestIT.java
===================================================================
--- test/agnostic/facelets/binding/src/test/java/com/sun/faces/test/agnostic/facelets/binding/AutomatedTestIT.java (revision 0)
+++ test/agnostic/facelets/binding/src/test/java/com/sun/faces/test/agnostic/facelets/binding/AutomatedTestIT.java (revision 0)
@@ -0,0 +1,115 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License"). You
+ * may not use this file except in compliance with the License. You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt. See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license." If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above. However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+package com.sun.faces.test.agnostic.facelets.binding;
+
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
+
+public class AutomatedTestIT {
+ /**
+ * Stores the web URL.
+ */
+ private String webUrl;
+ /**
+ * Stores the web client.
+ */
+ private WebClient webClient;
+
+ /**
+ * Setup before testing.
+ *
+ * @throws Exception when a serious error occurs.
+ */
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ }
+
+ /**
+ * Cleanup after testing.
+ *
+ * @throws Exception when a serious error occurs.
+ */
+ @AfterClass
+ public static void tearDownClass() throws Exception {
+ }
+
+ /**
+ * Setup before testing.
+ */
+ @Before
+ public void setUp() {
+ webUrl = System.getProperty("integration.url");
+ webClient = new WebClient();
+ }
+
+ /**
+ * Tear down after testing.
+ */
+ @After
+ public void tearDown() {
+ webClient.closeAllWindows();
+ }
+
+ @Test
+ public void testBuilderDefinedFlowWithMethodCall() throws Exception {
+ doTest("start_a");
+ }
+
+ @Test
+ public void testXmlDefinedFlowWithMethodCall() throws Exception {
+ doTest("start_b");
+ }
+
+ public void doTest(String startId) throws Exception {
+ HtmlPage page = webClient.getPage(webUrl);
+
+ assertTrue(page.getBody().asText().indexOf("") != -1);
+
+ }
+}
Index: test/agnostic/facelets/binding/src/main/java/com/sun/faces/test/agnostic/facelets/binding/UserBean.java
===================================================================
--- test/agnostic/facelets/binding/src/main/java/com/sun/faces/test/agnostic/facelets/binding/UserBean.java (revision 0)
+++ test/agnostic/facelets/binding/src/main/java/com/sun/faces/test/agnostic/facelets/binding/UserBean.java (revision 0)
@@ -0,0 +1,114 @@
+package com.sun.faces.test.agnostic.facelets.binding;
+
+import java.io.Serializable;
+import java.util.Date;
+import javax.enterprise.context.RequestScoped;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
+import javax.inject.Named;
+
+_at_Named
+_at_RequestScoped
+public class UserBean implements Serializable {
+
+ protected String firstName = "Duke";
+ protected String lastName = "Java";
+ protected Date dob;
+ protected String sex = "Unknown";
+ protected String email;
+ protected String serviceLevel = "medium";
+
+ public UserBean() {}
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public Date getDob() {
+ return dob;
+ }
+
+ public void setDob(Date dob) {
+ this.dob = dob;
+ }
+
+ public String getSex() {
+ return sex;
+ }
+
+ public void setSex(String sex) {
+ this.sex = sex;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getServiceLevel() {
+ return serviceLevel;
+ }
+
+ public void setServiceLevel(String serviceLevel) {
+ this.serviceLevel = serviceLevel;
+ }
+
+ public void validateEmail(FacesContext context, UIComponent toValidate,
+ Object value) throws ValidatorException {
+ String emailStr = (String) value;
+ if (-1 == emailStr.indexOf("@")) {
+ FacesMessage message = new FacesMessage("Invalid email address");
+ throw new ValidatorException(message);
+ }
+ }
+
+ public String addConfirmedUser() {
+ // This method would call a database or other service and add the
+ // confirmed user information.
+ // For now, we just place an informative message in request scope
+ FacesMessage doneMessage =
+ new FacesMessage("Successfully added new user");
+ FacesContext.getCurrentInstance().addMessage(null, doneMessage);
+ return "done";
+ }
+
+ private UIComponent nonComposite;
+
+ public UIComponent getNonComposite() {
+ return nonComposite;
+ }
+
+ public void setNonComposite(UIComponent boundComponent) {
+ this.nonComposite = boundComponent;
+ }
+
+
+ private UIComponent composite;
+
+ public UIComponent getComposite() {
+ return composite;
+ }
+
+ public void setComposite(UIComponent composite) {
+ this.composite = composite;
+ }
+
+}
+
Index: test/agnostic/facelets/binding/src/main/webapp/index.xhtml
===================================================================
--- test/agnostic/facelets/binding/src/main/webapp/index.xhtml (revision 0)
+++ test/agnostic/facelets/binding/src/main/webapp/index.xhtml (revision 0)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+-->
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html">
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <h:form prependId="false">
+ <h:inputText value="#{userBean.firstName}" />
+ <h:commandButton value="submit" />
+ </h:form>
+ </body>
+</html>
+
Index: test/agnostic/facelets/binding/src/main/webapp/WEB-INF/test.taglib.xml
===================================================================
--- test/agnostic/facelets/binding/src/main/webapp/WEB-INF/test.taglib.xml (revision 0)
+++ test/agnostic/facelets/binding/src/main/webapp/WEB-INF/test.taglib.xml (revision 0)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<facelet-taglib version="2.2"
+ xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facelettaglibrary_2_2.xsd">
+ <namespace>http://test.com/facelets</namespace>
+
+ <!-- Composites -->
+ <tag>
+ <tag-name>test</tag-name>
+ <component>
+ <resource-id>components/bind.xhtml</resource-id>
+ </component>
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Index: test/agnostic/facelets/binding/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- test/agnostic/facelets/binding/src/main/webapp/WEB-INF/beans.xml (revision 0)
+++ test/agnostic/facelets/binding/src/main/webapp/WEB-INF/beans.xml (revision 0)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This file can be an empty text file (0 bytes) -->
+<!-- We're declaring the schema to save you time if you do have to configure
+ this in the future -->
+<beans 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/beans_1_0.xsd">
+</beans>
Index: test/agnostic/facelets/binding/src/main/webapp/WEB-INF/web.xml
===================================================================
--- test/agnostic/facelets/binding/src/main/webapp/WEB-INF/web.xml (revision 0)
+++ test/agnostic/facelets/binding/src/main/webapp/WEB-INF/web.xml (revision 0)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+-->
+
+<web-app version="3.0" 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-app_3_0.xsd">
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
+ <param-value>/WEB-INF/test.taglib.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.developmentMode</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.compressViewState</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>faces/composite.xhtml</welcome-file>
+ </welcome-file-list>
+</web-app>
Index: test/agnostic/facelets/binding/src/main/webapp/WEB-INF/glassfish-web.xml
===================================================================
--- test/agnostic/facelets/binding/src/main/webapp/WEB-INF/glassfish-web.xml (revision 0)
+++ test/agnostic/facelets/binding/src/main/webapp/WEB-INF/glassfish-web.xml (revision 0)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
+<glassfish-web-app error-url="">
+ <context-root>/test-agnostic-facelets-binding</context-root>
+ <class-loader delegate="true"/>
+ <jsp-config>
+ <property name="keepgenerated" value="true">
+ <description>Keep a copy of the generated servlet class' java code.</description>
+ </property>
+ </jsp-config>
+</glassfish-web-app>
Index: test/agnostic/facelets/binding/src/main/webapp/resources/components/bind.xhtml
===================================================================
--- test/agnostic/facelets/binding/src/main/webapp/resources/components/bind.xhtml (revision 0)
+++ test/agnostic/facelets/binding/src/main/webapp/resources/components/bind.xhtml (revision 0)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:composite="http://java.sun.com/jsf/composite">
+ <composite:interface>
+ </composite:interface>
+
+ <composite:implementation>
+ </composite:implementation>
+</ui:composition>
\ No newline at end of file
Index: test/agnostic/facelets/binding/src/main/webapp/composite.xhtml
===================================================================
--- test/agnostic/facelets/binding/src/main/webapp/composite.xhtml (revision 0)
+++ test/agnostic/facelets/binding/src/main/webapp/composite.xhtml (revision 0)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:jid1="http://test.com/facelets">
+
+<h:head></h:head>
+<h:body>
+ <h:form id="commentBoxForm">
+ <jid1:test id="BindID" binding="#{userBean.composite}">
+ </jid1:test>
+
+ <h:commandLink value="Ajax refresh form">
+ <f:ajax execute="@form" render="@form" />
+ </h:commandLink>
+ <br />
+ <br />
+ <br />
+ <h:inputText binding="#{userBean.nonComposite}" />
+
+ <b>After Ajax refresh this id will be invalid. Full id: </b>
+ <h:outputText value="#{bind.clientId}" />
+
+
+ </h:form>
+</h:body>
+</html>
\ No newline at end of file
Index: test/agnostic/facelets/binding/pom.xml
===================================================================
--- test/agnostic/facelets/binding/pom.xml (revision 0)
+++ test/agnostic/facelets/binding/pom.xml (revision 0)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright (c) 1997-2013 Oracle and/or its affiliates. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License"). You
+ may not use this file except in compliance with the License. You can
+ obtain a copy of the License at
+ https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ or packager/legal/LICENSE.txt. See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at packager/legal/LICENSE.txt.
+
+ GPL Classpath Exception:
+ Oracle designates this particular file as subject to the "Classpath"
+ exception as provided by Oracle in the GPL Version 2 section of the License
+ file that accompanied this code.
+
+ Modifications:
+ If applicable, add the following below the License Header, with the fields
+ enclosed by brackets [] replaced by your own identifying information:
+ "Portions Copyright [year] [name of copyright owner]"
+
+ Contributor(s):
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license." If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above. However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+
+--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>pom</artifactId>
+ <groupId>com.sun.faces.test.agnostic.facelets</groupId>
+ <version>2.2.2-SNAPSHOT</version>
+ </parent>
+
+ <groupId>com.sun.faces.test.agnostic.facelets</groupId>
+ <artifactId>binding</artifactId>
+ <version>2.2.2-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>Mojarra ${project.version} - Test - Agnostic - Facelets - binding</name>
+ <build>
+ <finalName>test-agnostic-facelets-binding</finalName>
+ </build>
+
+</project>


SECTION: New Files
----------------------------
SEE ATTACHMENTS

--