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/11/26 19:35:07 UTC
svn commit: r1039499 [2/3] - in /myfaces/commons/branches/jsf_11/examples:
./ myfaces-commons-examples/
myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/
myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/exampl...
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/LICENSE.txt
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/LICENSE.txt?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/LICENSE.txt (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/LICENSE.txt Fri Nov 26 18:35:04 2010
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/NOTICE.txt
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/NOTICE.txt?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/NOTICE.txt (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/NOTICE.txt Fri Nov 26 18:35:04 2010
@@ -0,0 +1,16 @@
+=========================================================================
+== NOTICE file corresponding to section 4(d) of the Apache License, ==
+== Version 2.0, in this case for the Apache MyFaces Maven Plugins ==
+=========================================================================
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were originally based on the following:
+
+ - software copyright (c) 2000-2006, Oracle Corp, <http://www.oracle.com/>.
+and are licensed to the Apache Software Foundation under the
+"Software Grant and Corporate Contribution License Agreement"
+
+See the LICENSE.txt file for information on all licenses
+associated with this software.
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/pom.xml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/pom.xml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/pom.xml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,124 @@
+<?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.
+-->
+<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/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>commons11</artifactId>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <version>1.0.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-commons-facelets-examples11</artifactId>
+ <packaging>war</packaging>
+ <name>Apache MyFaces Commons Facelets Examples</name>
+ <version>1.0.1-SNAPSHOT</version>
+ <url>http://myfaces.apache.org</url>
+ <build>
+ <finalName>myfaces-commons-facelets-examples11</finalName>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>src/main/java</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.8</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots />
+ <id>apache-maven-snapshots</id>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ </repository>
+ <repository>
+ <id>java.net</id>
+ <url>http://download.java.net/maven/1</url>
+ <layout>legacy</layout>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-validators11</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-converters11</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.commons</groupId>
+ <artifactId>myfaces-components11</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>poi</groupId>
+ <artifactId>poi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/BooleanBean.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/BooleanBean.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/BooleanBean.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/BooleanBean.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,45 @@
+/*
+ * 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.commons.examples;
+
+
+public class BooleanBean
+{
+ private boolean way;
+
+ public BooleanBean()
+ {
+ }
+
+ public boolean getWay()
+ {
+ return way;
+ }
+
+ public void setWay(boolean way)
+ {
+ this.way = way;
+ }
+
+ public String submit()
+ {
+ System.out.println("Action was called.");
+ return ("valid");
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DataFieldHolder.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DataFieldHolder.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DataFieldHolder.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DataFieldHolder.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,52 @@
+/*
+ * 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.commons.examples;
+
+/**
+ * A typical simple backing bean, that is backed to <code>helloworld.jsp</code>
+ *
+ */
+public class DataFieldHolder {
+
+
+ //properties
+ private String name;
+
+ /**
+ * default empty constructor
+ */
+ public DataFieldHolder(){
+ }
+
+ //-------------------getter & setter
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Method that is backed to a submit button of a form.
+ */
+ public String send(){
+ //do real logic, return a string which will be used for the navigation system of JSF
+ return "success";
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DateTimeBean.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DateTimeBean.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DateTimeBean.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/DateTimeBean.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,101 @@
+/*
+ * 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.commons.examples;
+
+import java.util.Date;
+
+import javax.faces.component.UISelectOne;
+
+public class DateTimeBean
+{
+ private String type;
+
+ private Date date1;
+
+ private Date date2;
+
+ private UISelectOne typeSelect;
+
+ public DateTimeBean()
+ {
+ date1 = new Date();
+ type = "both";
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public Date getDate1()
+ {
+ return date1;
+ }
+
+ public void setDate1(Date date1)
+ {
+ this.date1 = date1;
+ }
+
+ public Date getDate2()
+ {
+ return date2;
+ }
+
+ public void setDate2(Date date2)
+ {
+ this.date2 = date2;
+ }
+
+ public String[] getInvalidMonths()
+ {
+ return new String[]{"jan", "apr", "sep"};
+ }
+
+ public String submit()
+ {
+ System.out.println("Action was called.");
+ return ("valid");
+ }
+
+ public String getTypeFromSelect()
+ {
+ Object value = typeSelect.getValue();
+ if (value != null)
+ {
+ return value.toString();
+ }
+ return null;
+ }
+
+ public UISelectOne getTypeSelect()
+ {
+ return typeSelect;
+ }
+
+ public void setTypeSelect(UISelectOne typeSelect)
+ {
+ this.typeSelect = typeSelect;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/NumberBean.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/NumberBean.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/NumberBean.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/NumberBean.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,86 @@
+/*
+ * 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.commons.examples;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UISelectOne;
+
+public class NumberBean
+{
+ private String type;
+
+ private Map<String, Double> numberMap;
+
+ private UISelectOne typeSelect;
+
+ public NumberBean()
+ {
+ numberMap = new HashMap<String, Double>();
+ numberMap.put("number1", 0.5d);
+ type = "percent";
+ }
+
+ public Map<String, Double> getNumberMap()
+ {
+ return numberMap;
+ }
+
+ public void setNumberMap(Map<String, Double> numberMap)
+ {
+ this.numberMap = numberMap;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String submit()
+ {
+ System.out.println("Action was called.");
+ return ("valid");
+ }
+
+ public String getTypeFromSelect()
+ {
+ Object value = typeSelect.getValue();
+ if (value != null)
+ {
+ return value.toString();
+ }
+ return null;
+ }
+
+ public UISelectOne getTypeSelect()
+ {
+ return typeSelect;
+ }
+
+ public void setTypeSelect(UISelectOne typeSelect)
+ {
+ this.typeSelect = typeSelect;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessTrackingVariableResolver.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessTrackingVariableResolver.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessTrackingVariableResolver.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessTrackingVariableResolver.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.commons.examples.accessedbeans;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.VariableResolver;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: matzew $)
+ * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
+ */
+public class AccessTrackingVariableResolver extends VariableResolver
+{
+ private VariableResolver delegate;
+
+ /**Implementing delegate-pattern
+ *
+ * @param delegate Delegating to this instance.
+ */
+ public AccessTrackingVariableResolver(VariableResolver delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ // METHODS
+ public Object resolveVariable(FacesContext facesContext, String name) throws EvaluationException
+ {
+ Object resolvedBean = delegate.resolveVariable(facesContext, name);
+
+ if(!(resolvedBean instanceof AccessedBeans) && resolvedBean!=null)
+ {
+ if(!resolvedBean.getClass().getName().startsWith("java.lang.") && !(resolvedBean instanceof Map))
+ {
+ ((AccessedBeans) facesContext.getApplication().
+ getVariableResolver().resolveVariable(facesContext,"accessedBeans")).addBean(name, resolvedBean);
+ }
+ }
+
+ return resolvedBean;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessedBeans.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessedBeans.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessedBeans.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/accessedbeans/AccessedBeans.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,88 @@
+/*
+ * 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.commons.examples.accessedbeans;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Martin Marinschek (latest modification by $Author: matzew $)
+ * @version $Revision: 167718 $ $Date: 2005-03-24 17:47:11 +0100 (Do, 24 Mär 2005) $
+ */
+public class AccessedBeans
+{
+ private List beanList;
+
+ public List getBeanList()
+ {
+ if(beanList == null)
+ beanList = new ArrayList();
+
+ return beanList;
+ }
+
+ public void setBeanList(List beanList)
+ {
+ this.beanList = beanList;
+ }
+
+ public void addBean(String name, Object resolvedBean)
+ {
+ List li = getBeanList();
+
+ for (int i = 0; i < li.size(); i++)
+ {
+ AccessedBean accessedBean = (AccessedBean) li.get(i);
+ if(accessedBean.getName().equals(name))
+ return;
+ }
+
+ AccessedBean bean = new AccessedBean();
+ bean.setName(name);
+ bean.setClazz(resolvedBean.getClass().getName());
+
+ li.add(bean);
+ }
+
+ public static class AccessedBean
+ {
+ private String name;
+ private String clazz;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getClazz()
+ {
+ return clazz;
+ }
+
+ public void setClazz(String clazz)
+ {
+ this.clazz = clazz;
+ }
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/EducationLevel.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,29 @@
+/*
+ * 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.commons.examples.validate;
+
+public enum EducationLevel
+{
+ NONE,
+ PRIMARY,
+ SECUNDARY,
+ UNIVERSITY,
+ MASTER,
+ DOCTOR
+}
\ No newline at end of file
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateCreditCard.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,119 @@
+/*
+ * 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.commons.examples.validate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UISelectOne;
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+
+/**
+ * @author mwessendorf
+ * @version $Revision: 673801 $ $Date: 2008-07-03 22:58:48 +0200 (Thu, 03 Jul 2008) $
+ */
+public class ValidateCreditCard {
+
+ private String creditCardNumber = null;
+
+ private String creditCardType = "MASTERCARD";
+
+ private List<SelectItem> types = null;
+
+ private UISelectOne creditCardTypeSelect;
+
+ public List<SelectItem> getCreditCardTypes()
+ {
+ if (types == null)
+ {
+ types = new ArrayList<SelectItem>();
+ types.add(new SelectItem("MASTERCARD"));
+ types.add(new SelectItem("VISA"));
+ types.add(new SelectItem("DISCOVER"));
+ types.add(new SelectItem("AMEX"));
+ }
+ return types;
+ }
+
+ public String submit(){
+ System.out.println("Action was called.");
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("The selected credit card type/number is valid"));
+ return ("valid");
+ }
+
+ public String getCreditCardNumber() {
+ return creditCardNumber;
+ }
+
+ public void setCreditCardNumber(String string) {
+ creditCardNumber = string;
+ }
+
+ public String getCreditCardType()
+ {
+ return creditCardType;
+ }
+
+ public void setCreditCardType(String creditCardType)
+ {
+ this.creditCardType = creditCardType;
+ }
+
+ public boolean isAmex()
+ {
+ return "AMEX".equalsIgnoreCase(creditCardType);
+ }
+
+ public boolean isVisa()
+ {
+ return "VISA".equalsIgnoreCase(creditCardType);
+ }
+
+ public boolean isMastercard()
+ {
+ return "MASTERCARD".equalsIgnoreCase(creditCardType);
+ }
+
+ public boolean isDiscover()
+ {
+ return "DISCOVER".equalsIgnoreCase(creditCardType);
+ }
+
+ public UISelectOne getCreditCardTypeSelect()
+ {
+ return creditCardTypeSelect;
+ }
+
+ public void setCreditCardTypeSelect(UISelectOne creditCardTypeSelect)
+ {
+ this.creditCardTypeSelect = creditCardTypeSelect;
+ }
+
+ public String getCreditCardTypeFromSelect()
+ {
+ Object value = creditCardTypeSelect.getValue();
+ if (value != null)
+ {
+ return value.toString();
+ }
+ return null;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateEnum.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,44 @@
+/*
+ * 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.commons.examples.validate;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+public class ValidateEnum
+{
+
+ private EducationLevel level;
+
+ public EducationLevel getLevel()
+ {
+ return level;
+ }
+
+ public void setLevel(EducationLevel level)
+ {
+ this.level = level;
+ }
+
+ public String submit(){
+ System.out.println("Action was called.");
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("The selected value is valid"));
+ return ("valid");
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/examples/validate/ValidateForm.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,121 @@
+/*
+ * 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.commons.examples.validate;
+
+/**
+ * @author mwessendorf
+ * @version $Revision: 673801 $ $Date: 2008-07-03 22:58:48 +0200 (Thu, 03 Jul 2008) $
+ */
+public class ValidateForm {
+
+ private String email = null;
+ private String email2 = null;
+ private String creditCardNumber = null;
+ private String url = null;
+ private String regExpr = null;
+
+ private String equal = null;
+ private String equal2 = null;
+
+ private String isbn =null;
+
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String string) {
+ email = string;
+ }
+
+ public String submit(){
+ System.out.println("Action was called.");
+ return ("valid");
+ }
+
+ public String getCreditCardNumber() {
+ return creditCardNumber;
+ }
+ public String getUrl(){
+ return url;
+ }
+ public void setCreditCardNumber(String string) {
+ creditCardNumber = string;
+ }
+ public void setUrl(String string) {
+ url = string;
+ }
+
+ public String getEmail2() {
+ return email2;
+ }
+
+ public void setEmail2(String string) {
+ email2 = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getRegExpr() {
+ return regExpr;
+ }
+
+ /**
+ * @param string
+ */
+ public void setRegExpr(String string) {
+ regExpr = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getEqual2() {
+ return equal2;
+ }
+
+ /**
+ * @param string
+ */
+ public void setEqual2(String string) {
+ equal2 = string;
+ }
+
+ /**
+ * @return
+ */
+ public String getEqual() {
+ return equal;
+ }
+
+ /**
+ * @param string
+ */
+ public void setEqual(String string) {
+ equal = string;
+ }
+
+ public String getIsbn() {
+ return isbn;
+ }
+ public void setIsbn(String isbn) {
+ this.isbn = isbn;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/ExporterBean.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.commons.exporter;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author cagatay (latest modification by $Author: skitching $)
+ * @version $Revision: 673833 $ $Date: 2008-07-03 23:58:05 +0200 (Thu, 03 Jul 2008) $
+ */
+public class ExporterBean implements Serializable {
+
+ private List carsList;
+
+ public List getCarsList() {
+ if( carsList == null)
+ carsList = createCarsList();
+ return carsList;
+ }
+
+ public void setCarsList(List carsList) {
+ this.carsList = carsList;
+ }
+
+ private List createCarsList() {
+ List list = new ArrayList();
+
+ for(int i = 0; i < 10; ++i) {
+ list.add( new SimpleCar(i, "row" + i, "value" + i));
+ }
+ return list;
+ }
+
+ public String export() {
+ return null;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/exporter/SimpleCar.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,75 @@
+/*
+ * 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.commons.exporter;
+
+import java.io.Serializable;
+
+/**
+ * DOCUMENT ME!
+ * @author Thomas Spiegl (latest modification by $Author: lu4242 $)
+ * @version $Revision: 651110 $ $Date: 2008-04-24 01:46:09 +0200 (Thu, 24 Apr 2008) $
+ */
+public class SimpleCar
+ implements Serializable
+{
+ /**
+ * serial id for serialisation versioning
+ */
+ private static final long serialVersionUID = 1L;
+ private int _id;
+ private String _type;
+ private String _color;
+
+ public SimpleCar(int id, String type, String color)
+ {
+ _id = id;
+ _type = type;
+ _color = color;
+ }
+
+ public int getId()
+ {
+ return _id;
+ }
+
+ public void setId(int id)
+ {
+ _id = id;
+ }
+
+ public String getType()
+ {
+ return _type;
+ }
+
+ public void setType(String type)
+ {
+ _type = type;
+ }
+
+ public String getColor()
+ {
+ return _color;
+ }
+
+ public void setColor(String color)
+ {
+ _color = color;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/renderone/RenderOneBean.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/renderone/RenderOneBean.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/renderone/RenderOneBean.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/renderone/RenderOneBean.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,107 @@
+/*
+ * 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.commons.renderone;
+
+import java.io.Serializable;
+
+/**
+ * @author Andrew Robinson (latest modification by $Author: skitching $)
+ * @version $Revision: 676967 $ $Date: 2008-07-15 18:57:23 +0200 (Tue, 15 Jul 2008) $
+ */
+public class RenderOneBean implements Serializable
+{
+ private boolean aRendered = false;
+ private boolean cRendered = true;
+ private boolean dRendered = true;
+ private boolean bRendered = true;
+
+ private Integer index = new Integer("2");
+
+ /**
+ * @return the index
+ */
+ public Integer getIndex()
+ {
+ return this.index;
+ }
+
+ /**
+ * @return the aRendered
+ */
+ public boolean isARendered()
+ {
+ return this.aRendered;
+ }
+
+ /**
+ * @param rendered the aRendered to set
+ */
+ public void setARendered(boolean rendered)
+ {
+ this.aRendered = rendered;
+ }
+
+ /**
+ * @return the cRendered
+ */
+ public boolean isCRendered()
+ {
+ return this.cRendered;
+ }
+
+ /**
+ * @param rendered the cRendered to set
+ */
+ public void setCRendered(boolean rendered)
+ {
+ this.cRendered = rendered;
+ }
+
+ /**
+ * @return the dRendered
+ */
+ public boolean isDRendered()
+ {
+ return this.dRendered;
+ }
+
+ /**
+ * @param rendered the dRendered to set
+ */
+ public void setDRendered(boolean rendered)
+ {
+ this.dRendered = rendered;
+ }
+
+ /**
+ * @return the bRendered
+ */
+ public boolean isBRendered()
+ {
+ return this.bRendered;
+ }
+
+ /**
+ * @param rendered the bRendered to set
+ */
+ public void setBRendered(boolean rendered)
+ {
+ this.bRendered = rendered;
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/servlet/SourceCodeServlet.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/servlet/SourceCodeServlet.java?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/servlet/SourceCodeServlet.java (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/java/org/apache/myfaces/commons/servlet/SourceCodeServlet.java Fri Nov 26 18:35:04 2010
@@ -0,0 +1,129 @@
+/*
+ * 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.commons.servlet;
+
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class SourceCodeServlet extends HttpServlet
+{
+ public void doGet(HttpServletRequest req, HttpServletResponse res)
+ throws IOException, ServletException
+ {
+ String webPage = req.getServletPath();
+
+ // remove the '*.source' suffix that maps to this servlet
+ int chopPoint = webPage.lastIndexOf(".source");
+
+ webPage = webPage.substring(0, chopPoint);
+
+ if(webPage.endsWith(".jsf"))
+ {
+ int jsfChopPoint = webPage.lastIndexOf(".jsf");
+
+ webPage = webPage.substring(0, jsfChopPoint);
+
+ webPage += ".xhtml"; // replace jsf with jsp
+
+ // get the actual file location of the requested resource
+ String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+
+ outputFile(res, realPath);
+ }
+ else if(webPage.endsWith(".jsp"))
+ {
+ // get the actual file location of the requested resource
+ String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+
+ outputFile(res, realPath);
+ }
+ else if(webPage.endsWith(".jspx"))
+ {
+ // get the actual file location of the requested resource
+ String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+
+ outputFile(res, realPath);
+ }
+ else if(webPage.endsWith(".xhtml"))
+ {
+ // get the actual file location of the requested resource
+ String realPath = getServletConfig().getServletContext().getRealPath(webPage);
+
+ outputFile(res, realPath);
+ }
+ else
+ {
+ int beginChopPoint = webPage.lastIndexOf("/");
+ int extensionChopPoint = webPage.lastIndexOf(".java");
+
+ webPage = webPage.substring(beginChopPoint+1,extensionChopPoint);
+
+ try
+ {
+
+ // get the actual file location of the requested resource; try it in classes first
+ String realPath = getServletConfig().getServletContext().getRealPath("/WEB-INF/classes/"+webPage.replace('.','/')+".java");
+
+ outputFile(res, realPath);
+ }
+ catch(Exception e)
+ {
+ //classes hasn't worked. How about src?
+ String realPath = getServletConfig().getServletContext().getRealPath("/WEB-INF/src/"+webPage.replace('.','/')+".java");
+
+ outputFile(res, realPath);
+ }
+
+ }
+ }
+
+ private void outputFile(HttpServletResponse res, String realPath)
+ throws IOException
+ {
+ // output an HTML page
+ res.setContentType("text/plain");
+
+ // print some html
+ ServletOutputStream out = res.getOutputStream();
+
+ // print the file
+ InputStream in = null;
+ try
+ {
+ in = new BufferedInputStream(new FileInputStream(realPath));
+ int ch;
+ while ((ch = in.read()) !=-1)
+ {
+ out.print((char)ch);
+ }
+ }
+ finally {
+ if (in != null) in.close(); // very important
+ }
+ }
+}
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/resources/org/apache/myfaces/examples/resource/example_messages.properties
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/resources/org/apache/myfaces/examples/resource/example_messages.properties?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/resources/org/apache/myfaces/examples/resource/example_messages.properties (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/resources/org/apache/myfaces/examples/resource/example_messages.properties Fri Nov 26 18:35:04 2010
@@ -0,0 +1,21 @@
+button_submit = Submit
+email_comma = Email separated by ,
+credit_dot = Credit Card separated by .
+credit_number = Insert a credit card number
+credit_type = Please select one card type
+url_comma = Url separated by ,
+isbn_semicolon = ISBN separated by ;
+validate_email = Email
+validate_credit = Credit Card
+validate_url = Url
+validate_enum = Enumeration (NONE,PRIMARY,SECUNDARY,UNIVERSITY,MASTER,DOCTOR)
+validate_regexp = Regular Expression(bat,cat,rat are valid values)
+validate_isbn = ISBN
+validate_base = Base value
+validate_equal = Validate Equal
+validate_notequal = Validate Not Equal
+validate_greaterthan = Validate Greater Than
+validate_greaterthanequal = Validate Greater Than Equal
+validate_lessthan = Validate Less Than
+validate_lessthanequal =Validate Less Than Equal
+title=Myfaces Commons Example
\ No newline at end of file
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/footer.xhtml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/footer.xhtml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/footer.xhtml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/footer.xhtml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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"
+ xmlns:t="http://myfaces.apache.org/tomahawk">
+<body>
+<ui:composition>
+ <br/>
+ <br/>
+ <a href="home.jsf">[HOME]</a>
+
+ <a href="#{request.requestURI}.source">[SOURCE]</a>
+</ui:composition>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/mbean_source.xhtml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/mbean_source.xhtml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/mbean_source.xhtml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/mbean_source.xhtml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
+<body>
+<ui:composition>
+ <br/>
+ <br/>
+ <h:dataTable value="#{accessedBeans.beanList}" var="accessedBean">
+ <h:column>
+ <h:outputLink value="#{accessedBean.clazz}.java.source" disabled="#{!fn:startsWith(accessedBean.clazz,'org.apache.myfaces.commons')}">
+ <h:outputText value="Usage of bean with name : "/>
+ <h:outputText value="#{accessedBean.name}"/>
+ <h:outputText value=" and class : "/>
+ <h:outputText value="#{accessedBean.clazz}"/>
+ </h:outputLink>
+ </h:column>
+ </h:dataTable>
+</ui:composition>
+</body>
+</html>
\ No newline at end of file
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/template.xhtml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/template.xhtml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/template.xhtml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/META-INF/templates/template.xhtml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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">
+<head>
+ <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
+ <title>MyFaces - the free JSF Implementation</title>
+ <link rel="stylesheet" type="text/css" href="./css/basic.css" />
+ <ui:insert name="head"/>
+</head>
+<body>
+ <f:loadBundle
+ basename="org.apache.myfaces.examples.resource.example_messages"
+ var="example_messages" />
+<div id="container">
+ <h1><h:outputText value="#{example_messages['title']}"/></h1>
+ <br/>
+ <ui:insert name="body"/>
+ <ui:insert name="mbean_source">
+ <ui:include src="/META-INF/templates/mbean_source.xhtml"/>
+ </ui:insert>
+ <ui:insert name="footer">
+ <ui:include src="/META-INF/templates/footer.xhtml"/>
+ </ui:insert>
+</div>
+</body>
+</html>
\ No newline at end of file
Propchange: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Nov 26 18:35:04 2010
@@ -0,0 +1 @@
+*.jsfdia
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/faces-config.xml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,73 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+
+<faces-config>
+
+ <!-- from project setup -->
+ <application>
+ <variable-resolver>org.apache.myfaces.commons.examples.accessedbeans.AccessTrackingVariableResolver</variable-resolver>
+ <view-handler>
+ com.sun.facelets.FaceletViewHandler
+ </view-handler>
+ </application>
+
+ <!-- Accessed beans on the last request -->
+ <managed-bean>
+ <managed-bean-name>accessedBeans</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.accessedbeans.AccessedBeans</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>dataFieldHolder</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.DataFieldHolder</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <!-- validation -->
+ <managed-bean>
+ <managed-bean-name>validateForm</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateForm</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>validateEnum</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateEnum</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>exporterBean</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.exporter.ExporterBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>renderOne</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.renderone.RenderOneBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>validateCreditCard</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.validate.ValidateCreditCard</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>dateTimeBean</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.DateTimeBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>numberBean</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.NumberBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>booleanBean</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.commons.examples.BooleanBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/web.xml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/web.xml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/WEB-INF/web.xml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <description>MyProject web.xml</description>
+
+
+ <context-param>
+ <description>State saving method: "client" or "server" (= default) See JSF Specification 2.5.3</description>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ </context-param>
+
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to verify that all of the application
+ objects you have configured (components, converters,
+ renderers, and validators) can be successfully created.
+ Default value is false.
+ </description>
+ </context-param>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>SourceCodeServlet</servlet-name>
+ <servlet-class>org.apache.myfaces.commons.servlet.SourceCodeServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>SourceCodeServlet</servlet-name>
+ <url-pattern>*.source</url-pattern>
+ </servlet-mapping>
+
+ <!-- Welcome files -->
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertBoolean.xhtml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertBoolean.xhtml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertBoolean.xhtml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertBoolean.xhtml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,64 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:mcv="http://myfaces.apache.org/commons/validators"
+ xmlns:mcc="http://myfaces.apache.org/commons/converters"
+ xmlns:mc="http://myfaces.apache.org/commons/components">
+
+<!--
+/*
+ * 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.
+ */
+//-->
+
+<body>
+<ui:composition template="/META-INF/templates/template.xhtml">
+ <ui:define name="body">
+ <h:panelGroup id="body">
+ <p>This example check how mcc:convertBoolean works. This converter
+ translates between boolean values (true/false)
+ and alternate versions of those boolean values like
+ (yes/no), (1/0), and (way/no way).</p>
+ <h:form id="form1">
+ <h:messages showDetail="false" showSummary="true" ></h:messages>
+ <p>Current value: <h:outputText value="#{booleanBean.way}"/></p>
+ <h:panelGrid columns="3">
+
+ <h:outputLabel for="boolVal" value="" />
+ <h:inputText id="boolVal" value="#{booleanBean.way}" required="true">
+ <mcc:convertBoolean trueValue="way" falseValue="no way" />
+ </h:inputText>
+ <h:message for="boolVal" styleClass="error" />
+
+ <h:panelGroup />
+ <h:commandButton id="validateButton"
+ value="#{example_messages['button_submit']}"
+ action="#{booleanBean.submit}" />
+ <h:panelGroup />
+
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGroup>
+ </ui:define>
+</ui:composition>
+</body>
+
+</html>
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertDateTime.xhtml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertDateTime.xhtml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertDateTime.xhtml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertDateTime.xhtml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,74 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:mcv="http://myfaces.apache.org/commons/validators"
+ xmlns:mcc="http://myfaces.apache.org/commons/converters"
+ xmlns:mc="http://myfaces.apache.org/commons/components">
+
+<!--
+/*
+ * 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.
+ */
+//-->
+
+<body>
+<ui:composition template="/META-INF/templates/template.xhtml">
+ <ui:define name="body">
+ <h:panelGroup id="body">
+ <p>This example shows how mcc:convertDateTime component works. It works almost
+ the same as f:convertDateTime, but it has as TimeZone default
+ TimeZone.getDefault() instead GMT and it evaluate EL expressions when the value
+ is being validated instead when the converter is built. </p>
+ <p>Current Locale: <h:outputText value="#{facesContext.viewRoot.locale}"/></p>
+ <h:form id="form1">
+ <h:messages showDetail="false" showSummary="true" ></h:messages>
+ <h:panelGrid columns="3">
+
+ <h:outputLabel for="type"
+ value="Insert a type" />
+ <h:selectOneMenu id="type" immediate="true" value="#{dateTimeBean.type}" >
+ <f:selectItem itemLabel="date" itemValue="date"/>
+ <f:selectItem itemLabel="time" itemValue="time"/>
+ <f:selectItem itemLabel="both" itemValue="both"/>
+ </h:selectOneMenu>
+ <h:message for="type" styleClass="error" />
+
+ <h:outputLabel for="date1"
+ value="Insert a date/time" />
+ <h:inputText id="date1" value="#{dateTimeBean.date1}" required="true">
+ <mcc:convertDateTime type="#{mc:findComponent('form1:type').value}"/>
+ </h:inputText>
+ <h:message for="date1" styleClass="error" />
+
+ <h:panelGroup />
+ <h:commandButton id="validateButton"
+ value="#{example_messages['button_submit']}"
+ action="#{dateTimeBean.submit}" />
+ <h:panelGroup />
+
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGroup>
+ </ui:define>
+</ui:composition>
+</body>
+
+</html>
Added: myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertEnum.xhtml
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertEnum.xhtml?rev=1039499&view=auto
==============================================================================
--- myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertEnum.xhtml (added)
+++ myfaces/commons/branches/jsf_11/examples/myfaces-commons-facelets-examples/src/main/webapp/convertEnum.xhtml Fri Nov 26 18:35:04 2010
@@ -0,0 +1,63 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:mcv="http://myfaces.apache.org/commons/validators"
+ xmlns:mcc="http://myfaces.apache.org/commons/converters"
+ xmlns:mc="http://myfaces.apache.org/commons/components">
+
+<!--
+/*
+ * 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.
+ */
+//-->
+
+<body>
+<ui:composition template="/META-INF/templates/template.xhtml">
+ <ui:define name="body">
+ <h:panelGroup id="body">
+ <p>This example check if the input provided can be used to retrieve a
+ enumeration value using mcc:convertEnum.</p>
+ <h:form id="form1">
+ <h:messages showDetail="false" showSummary="true" ></h:messages>
+ <h:panelGrid columns="3">
+
+ <h:outputLabel for="enum"
+ value="#{example_messages['validate_enum']}" />
+ <h:inputText id="enum" value="#{validateEnum.level}" required="true">
+ <mcc:convertEnum
+ targetClass="org.apache.myfaces.commons.examples.validate.EducationLevel" />
+ </h:inputText>
+ <h:message id="enumError" for="enum" styleClass="error" />
+
+ <h:panelGroup />
+ <h:commandButton id="validateButton"
+ value="#{example_messages['button_submit']}"
+ action="#{validateEnum.submit}" />
+ <h:panelGroup />
+
+ </h:panelGrid>
+ </h:form>
+
+ </h:panelGroup>
+ </ui:define>
+</ui:composition>
+</body>
+
+</html>