dev@javaserverfaces.java.net

Seeking Review [spec-490] new automated test

From: Ed Burns <edburns_at_sun.com>
Date: Tue, 17 Aug 2010 11:58:41 -0700

Found a bug when submitting form to an XML view https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=490

SECTION: Modified Files
----------------------------
M jsf-ri/src/main/java/com/sun/faces/application/view/MultiViewHandler.java

- in getActionURL(), don't assume that viewId.lastIndexOf(".") will get
  you the full extension. If your extension is ".view.xml", it won't.

M jsf-ri/systest/web/view.xml/index.view.xml
M jsf-ri/systest/build-tests.xml
A jsf-ri/systest/src/com/sun/faces/systest/view/xml
A jsf-ri/systest/src/com/sun/faces/systest/view/xml/ViewXmlTestCase.java
A jsf-ri/systest/web/view.xml/header.view.xml
A jsf-ri/systest/web/view.xml/xhtmlTemplate.xhtml
A jsf-ri/systest/web/view.xml/includedInFooter.view.xml
A jsf-ri/systest/web/view.xml/includedInFooter.xhtml
A jsf-ri/systest/web/view.xml/footer.xhtml
A jsf-ri/systest/web/view.xml/templateClientUsingXmlAndXhtml.view.xml
D jsf-ri/systest/web/golden/index.view.faces.txt

SECTION: Diffs

Index: jsf-ri/src/main/java/com/sun/faces/application/view/MultiViewHandler.java
===================================================================
--- jsf-ri/src/main/java/com/sun/faces/application/view/MultiViewHandler.java (revision 8558)
+++ jsf-ri/src/main/java/com/sun/faces/application/view/MultiViewHandler.java (working copy)
@@ -308,6 +308,13 @@
         if (period < 0) {
             return (contextPath + viewId + mapping);
         } else if (!viewId.endsWith(mapping)) {
+
+ for (String ext : configuredExtensions) {
+ if (viewId.endsWith(ext)) {
+ return (contextPath + viewId.substring(0, viewId.indexOf(ext)) + mapping);
+ }
+ }
+
             return (contextPath + viewId.substring(0, period) + mapping);
         } else {
             return (contextPath + viewId);
Index: jsf-ri/systest/web/view.xml/index.view.xml
===================================================================
--- jsf-ri/systest/web/view.xml/index.view.xml (revision 8558)
+++ jsf-ri/systest/web/view.xml/index.view.xml (working copy)
@@ -1,4 +1,39 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 2010 Sun Microsystems, Inc. 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.html
+ or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [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.
+-->
 <faces-view 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-facesview_2_1.xsd"
Index: jsf-ri/systest/build-tests.xml
===================================================================
--- jsf-ri/systest/build-tests.xml (revision 8558)
+++ jsf-ri/systest/build-tests.xml (working copy)
@@ -193,11 +193,14 @@
     </target>
 
     <target name="test.view.xml">
- <jsf.tester
- request="${context.path}/view.xml/index.faces"
- golden="${golden.path}/index.view.faces.txt"
- ignoreIfContains="${ignore.path}/ignoreIfContains.txt"
- />
+ <jsf.junit context-path="${context.path}"
+ classpath-refid="html.classpath"
+ test-results-dir="${impl.test.results.dir}">
+ <tests>
+ <fileset dir="${basedir}/build/classes"
+ includes="com/sun/faces/systest/view/xml/*TestCase.class"/>
+ </tests>
+ </jsf.junit>
     </target>
 
 
@@ -1379,11 +1382,7 @@
     </target>
 
     <target name="passthru">
- <jsf.tester
- request="${context.path}/view.xml/index.faces"
- golden="${golden.path}/index.view.faces.txt"
- ignoreIfContains="${ignore.path}/ignoreIfContains.txt"
- />
+ <antcall target="test.view.xml" />
     </target>
 
 
Index: jsf-ri/systest/src/com/sun/faces/systest/view/xml/ViewXmlTestCase.java
===================================================================
--- jsf-ri/systest/src/com/sun/faces/systest/view/xml/ViewXmlTestCase.java (revision 0)
+++ jsf-ri/systest/src/com/sun/faces/systest/view/xml/ViewXmlTestCase.java (revision 0)
@@ -0,0 +1,124 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2010 Sun Microsystems, Inc. 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.html
+ * or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [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.systest.view.xml;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+import com.sun.faces.htmlunit.AbstractTestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * <p>Test Case for JSP Interoperability.</p>
+ */
+
+public class ViewXmlTestCase extends AbstractTestCase {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ /**
+ * Construct a new instance of this test case.
+ *
+ * @param name Name of the test case
+ */
+ public ViewXmlTestCase(String name) {
+ super(name);
+ }
+
+
+ // ------------------------------------------------------ Instance Variables
+
+
+ // ---------------------------------------------------- Overall Test Methods
+
+
+ /**
+ * Set up instance variables required by this test case.
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ }
+
+
+ /**
+ * Return the tests included in this test suite.
+ */
+ public static Test suite() {
+ return (new TestSuite(ViewXmlTestCase.class));
+ }
+
+
+ /**
+ * Tear down instance variables required by this test case.
+ */
+ public void tearDown() {
+ super.tearDown();
+ }
+
+
+ // ------------------------------------------------- Individual Test Methods
+
+
+ public void testPrefixAndExtensionMapping() throws Exception {
+ doTest("/view.xml/templateClientUsingXmlAndXhtml.faces", "foo", "bar");
+ doTest("/faces/view.xml/templateClientUsingXmlAndXhtml.view.xml", "baz", "baba");
+ }
+
+ public void testSimpleXml() throws Exception {
+ HtmlPage page = getPage("/view.xml/index.faces");
+ String text = page.asText();
+ assertTrue(text.matches("(?s).*Raw XML View\\s*hello\\s*reload.*"));
+
+
+ }
+
+ private void doTest(String path, String param1, String param2) throws Exception {
+ HtmlPage page = getPage(path + "?param1=" + param1 + "&param2=" + param2);
+ String text = page.asText();
+ assertTrue(text.matches("(?s).*Templating and XML views\\s*column1\\s*column2\\s*column3\\s*This is the header text declared in xhtmlTemplate.xhtml. The preceding columns are declared in header.view.xml.\\s*hello\\s*reload\\s*HTML table column 1\\s*HTML table column 2\\s*" +
+ param1 + "\\s*" + param2 + ".*"));
+ HtmlSubmitInput button = (HtmlSubmitInput) page.getElementById("button");
+ page = button.click();
+ text = page.asText();
+ assertTrue(text.matches("(?s).*Templating and XML views\\s*column1\\s*column2\\s*column3\\s*This is the header text declared in xhtmlTemplate.xhtml. The preceding columns are declared in header.view.xml.\\s*hello\\s*reload\\s*HTML table column 1\\s*HTML table column 2\\s*" +
+ param1 + "\\s*" + param2 + ".*"));
+
+ }
+
+}
Index: jsf-ri/systest/src/com/sun/faces/systest/view/xml/ViewXmlTestCase.java
===================================================================
--- jsf-ri/systest/src/com/sun/faces/systest/view/xml/ViewXmlTestCase.java (revision 0)
+++ jsf-ri/systest/src/com/sun/faces/systest/view/xml/ViewXmlTestCase.java (revision 0)
@@ -0,0 +1,124 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 1997-2010 Sun Microsystems, Inc. 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.html
+ * or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ * Sun designates this particular file as subject to the "Classpath" exception
+ * as provided by Sun in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the License
+ * Header, with the fields enclosed by brackets [] replaced by your own
+ * identifying information: "Portions Copyrighted [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.systest.view.xml;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
+import com.sun.faces.htmlunit.AbstractTestCase;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+
+/**
+ * <p>Test Case for JSP Interoperability.</p>
+ */
+
+public class ViewXmlTestCase extends AbstractTestCase {
+
+
+ // ------------------------------------------------------------ Constructors
+
+
+ /**
+ * Construct a new instance of this test case.
+ *
+ * @param name Name of the test case
+ */
+ public ViewXmlTestCase(String name) {
+ super(name);
+ }
+
+
+ // ------------------------------------------------------ Instance Variables
+
+
+ // ---------------------------------------------------- Overall Test Methods
+
+
+ /**
+ * Set up instance variables required by this test case.
+ */
+ public void setUp() throws Exception {
+ super.setUp();
+ }
+
+
+ /**
+ * Return the tests included in this test suite.
+ */
+ public static Test suite() {
+ return (new TestSuite(ViewXmlTestCase.class));
+ }
+
+
+ /**
+ * Tear down instance variables required by this test case.
+ */
+ public void tearDown() {
+ super.tearDown();
+ }
+
+
+ // ------------------------------------------------- Individual Test Methods
+
+
+ public void testPrefixAndExtensionMapping() throws Exception {
+ doTest("/view.xml/templateClientUsingXmlAndXhtml.faces", "foo", "bar");
+ doTest("/faces/view.xml/templateClientUsingXmlAndXhtml.view.xml", "baz", "baba");
+ }
+
+ public void testSimpleXml() throws Exception {
+ HtmlPage page = getPage("/view.xml/index.faces");
+ String text = page.asText();
+ assertTrue(text.matches("(?s).*Raw XML View\\s*hello\\s*reload.*"));
+
+
+ }
+
+ private void doTest(String path, String param1, String param2) throws Exception {
+ HtmlPage page = getPage(path + "?param1=" + param1 + "&param2=" + param2);
+ String text = page.asText();
+ assertTrue(text.matches("(?s).*Templating and XML views\\s*column1\\s*column2\\s*column3\\s*This is the header text declared in xhtmlTemplate.xhtml. The preceding columns are declared in header.view.xml.\\s*hello\\s*reload\\s*HTML table column 1\\s*HTML table column 2\\s*" +
+ param1 + "\\s*" + param2 + ".*"));
+ HtmlSubmitInput button = (HtmlSubmitInput) page.getElementById("button");
+ page = button.click();
+ text = page.asText();
+ assertTrue(text.matches("(?s).*Templating and XML views\\s*column1\\s*column2\\s*column3\\s*This is the header text declared in xhtmlTemplate.xhtml. The preceding columns are declared in header.view.xml.\\s*hello\\s*reload\\s*HTML table column 1\\s*HTML table column 2\\s*" +
+ param1 + "\\s*" + param2 + ".*"));
+
+ }
+
+}
Index: jsf-ri/systest/web/view.xml/header.view.xml
===================================================================
--- jsf-ri/systest/web/view.xml/header.view.xml (revision 0)
+++ jsf-ri/systest/web/view.xml/header.view.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 2010 Sun Microsystems, Inc. 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.html
+ or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [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.
+-->
+
+<faces-view 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-facesview_2_1.xsd"
+ version="2.1"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <h:panelGrid id="gridXml" column="3">
+
+ <h:outputText id="text1" value="column1"></h:outputText>
+
+ <h:outputText id="text2" value="column2"></h:outputText>
+
+ <h:outputText id="text3" value="column3"></h:outputText>
+
+ <ui:insert name="header"></ui:insert>
+
+ </h:panelGrid>
+
+</faces-view>
+
+
Index: jsf-ri/systest/web/view.xml/xhtmlTemplate.xhtml
===================================================================
--- jsf-ri/systest/web/view.xml/xhtmlTemplate.xhtml (revision 0)
+++ jsf-ri/systest/web/view.xml/xhtmlTemplate.xhtml (revision 0)
@@ -0,0 +1,79 @@
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2008 Sun Microsystems, Inc. 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.html
+ or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [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
+ 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:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xml:lang="en" lang="en">
+<head>
+ <title>Templating and XML views</title>
+</head>
+<body>
+
+ <ui:decorate template="header.view.xml">
+ <ui:define name="header">
+ <p>This is the header text declared in xhtmlTemplate.xhtml.
+ The preceding columns are declared in header.view.xml.</p>
+ </ui:define>
+ </ui:decorate>
+
+ <ui:insert name="body">
+
+ <p>default text</p>
+
+ </ui:insert>
+
+ <ui:decorate template="footer.xhtml">
+
+ <ui:define name="footer">
+ <td><ui:include src="includedInFooter.view.xml">
+ <ui:param name="param1" value="#{param['param1']}" />
+ </ui:include></td>
+ <ui:include src="includedInFooter.xhtml">
+ <ui:param name="param2" value="#{param['param2']}" />
+ </ui:include>
+ </ui:define>
+
+ </ui:decorate>
+
+
+</body>
+</html>
Index: jsf-ri/systest/web/view.xml/includedInFooter.view.xml
===================================================================
--- jsf-ri/systest/web/view.xml/includedInFooter.view.xml (revision 0)
+++ jsf-ri/systest/web/view.xml/includedInFooter.view.xml (revision 0)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 2010 Sun Microsystems, Inc. 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.html
+ or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [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.
+-->
+
+<faces-view 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-facesview_2_1.xsd"
+ version="2.1"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ #{param1}
+
+</faces-view>
+
+
Index: jsf-ri/systest/web/view.xml/includedInFooter.xhtml
===================================================================
--- jsf-ri/systest/web/view.xml/includedInFooter.xhtml (revision 0)
+++ jsf-ri/systest/web/view.xml/includedInFooter.xhtml (revision 0)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2008 Sun Microsystems, Inc. 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.html
+ or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [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.
+
+-->
+<td xmlns="http://www.w3.org/1999/xhtml">#{param2}</td>
\ No newline at end of file
Index: jsf-ri/systest/web/view.xml/footer.xhtml
===================================================================
--- jsf-ri/systest/web/view.xml/footer.xhtml (revision 0)
+++ jsf-ri/systest/web/view.xml/footer.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 2010 Sun Microsystems, Inc. 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.html
+ or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [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.
+-->
+
+<table xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html" border="1">
+
+ <tr>
+ <th>HTML table column 1</th>
+
+ <th>HTML table column 2</th>
+
+ </tr>
+
+ <tr>
+
+ <ui:insert name="footer" />
+
+ </tr>
+
+
+</table>
\ No newline at end of file
Index: jsf-ri/systest/web/view.xml/templateClientUsingXmlAndXhtml.view.xml
===================================================================
--- jsf-ri/systest/web/view.xml/templateClientUsingXmlAndXhtml.view.xml (revision 0)
+++ jsf-ri/systest/web/view.xml/templateClientUsingXmlAndXhtml.view.xml (revision 0)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 2010 Sun Microsystems, Inc. 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.html
+ or glassfish/bootstrap/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 glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code. If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [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.
+-->
+
+<faces-view 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-facesview_2_1.xsd"
+ version="2.1"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <f:metadata>
+ <f:viewParam name="param1" required="true" />
+ <f:viewParam name="param2" required="true" />
+ </f:metadata>
+
+ <h:html>
+
+ <h:head><h:title>Template client</h:title></h:head>
+
+ <h:body>
+
+ <!--
+ Make sure template clients declared in xml can use templates declared
+ both in xhtml and xml.
+ -->
+
+ <ui:composition template="xhtmlTemplate.xhtml">
+
+ <ui:define name="body">
+
+ <h:form prependId="false" id="form">
+
+ <h:panelGrid id="grid" column="2">
+
+ <h:outputText id="text" value="hello"></h:outputText>
+
+ <h:commandButton id="button"
+ value="reload">
+
+ <f:param name="param1" value="#{param['param1']}" />
+ <f:param name="param2" value="#{param['param2']}" />
+ </h:commandButton>
+
+ </h:panelGrid>
+
+ </h:form>
+
+ </ui:define>
+
+ </ui:composition>
+
+ </h:body>
+
+ </h:html>
+
+</faces-view>
+
+
Index: jsf-ri/systest/web/golden/index.view.faces.txt
===================================================================
--- jsf-ri/systest/web/golden/index.view.faces.txt (revision 8558)
+++ jsf-ri/systest/web/golden/index.view.faces.txt (working copy)
@@ -1,16 +0,0 @@
-<html><head><title>Raw XML View</title></head><body>
-<form id="form" name="form" method="post" action="/jsf-systest/view.xml/index.view.faces;jsessionid=b654e77213da0839b83f80345df2" enctype="application/x-www-form-urlencoded">
-<input type="hidden" name="form" value="form" />
-<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id1:j_id2" />
-<table id="grid">
-<tbody>
-<tr>
-<td><span id="text">hello</span></td>
-</tr>
-<tr>
-<td><input id="button" type="submit" name="button" value="reload" /></td>
-</tr>
-</tbody>
-</table>
-
-</form></body></html>

-- 
| edburns_at_sun.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/
| 01 work days until JSF 2.1 Milestone 2