You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/06/02 01:35:49 UTC
svn commit: r950308 [11/13] - in /myfaces/portlet-bridge/core/trunk_2.0.x:
./ api/src/main/java/javax/portlet/faces/
api/src/main/java/javax/portlet/faces/component/ examples/ examples/blank/
examples/blank/src/main/webapp/WEB-INF/ examples/carstore/ e...
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/greeting.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/greeting.jsp?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/greeting.jsp (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/greeting.jsp Tue Jun 1 23:35:42 2010
@@ -0,0 +1,88 @@
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xml:lang="en" lang="en">
+<jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+<jsp:directive.page contentType="application/xhtml+xml; charset=UTF-8"/>
+<head>
+ <title>Hello</title>
+</head>
+<body bgcolor="white">
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0!" height="31" width="88"/></a>
+</p>
+
+<f:view>
+ <h:form id="helloForm">
+ <h2>Hi. My name is Duke. I'm thinking of a number from
+ <h:outputText lang="en_US" value="#{UserNumberBean.minimum}"/>
+ to
+ <h:outputText value="#{UserNumberBean.maximum}"/>
+ . Can you guess
+ it?
+ </h2>
+
+ <h:graphicImage id="waveImg" url="/wave.med.gif"/>
+ <h:inputText id="userNo" label="User Number"
+ value="#{UserNumberBean.userNumber}"
+ validator="#{UserNumberBean.validate}"/>
+ <h:commandButton id="submit" action="success" value="Submit"/>
+ <p/>
+ <h:message showSummary="true" showDetail="false"
+ style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique; text-decoration: overline"
+ id="errors1" for="userNo"/>
+
+ </h:form>
+</f:view>
+
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0!" height="31" width="88"/></a>
+</p>
+</body>
+</html>
+
+</jsp:root>
\ No newline at end of file
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/index.jsp?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/index.jsp (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/index.jsp Tue Jun 1 23:35:42 2010
@@ -0,0 +1,63 @@
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xml:lang="en" lang="en">
+<jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Trasitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+<jsp:directive.page contentType="application/xhtml+xml; charset=UTF-8"/>
+<head>
+</head>
+<body>
+
+<!--
+
+This page allows the user to go to the context-path and get redirected
+to the front page of the app. For example,
+http://localhost:8080/jsf-carstore/. Note that we use "*.jsf" as the
+page mapping. Doing so allows us to just name our pages as "*.jsp",
+refer to them as "*.jsf" and know that they will be properly picked up
+by the container.
+
+-->
+
+<jsp:forward page="guess/greeting.jsp"/>
+</body>
+</html>
+</jsp:root>
\ No newline at end of file
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/response.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/response.jsp?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/response.jsp (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/response.jsp Tue Jun 1 23:35:42 2010
@@ -0,0 +1,72 @@
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xml:lang="en" lang="en">
+<jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+<jsp:directive.page contentType="application/xhtml+xml; charset=UTF-8"/>
+<head>
+ <title>Guess The Number</title>
+</head>
+<body bgcolor="white">
+<f:view>
+ <h:form id="responseForm">
+ <h:graphicImage id="waveImg" url="/wave.med.gif"/>
+ <h2>
+ <h:outputText id="result" lang="en"
+ value="#{UserNumberBean.response}"/>
+ </h2>
+ <h:commandButton id="back" value="Back" action="success"/>
+ <p/>
+
+ </h:form>
+</f:view>
+
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0!" height="31" width="88"/></a>
+</p>
+
+</body>
+</html>
+</jsp:root>
\ No newline at end of file
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/wave.med.gif
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/wave.med.gif?rev=950308&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraFilter/src/main/webapp/wave.med.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/pom.xml?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/pom.xml (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/pom.xml Tue Jun 1 23:35:42 2010
@@ -0,0 +1,232 @@
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <name>MyFaces Portlet Bridge GuessNumber JSP with Mojarra WriteBehind PortletResponseWrapper Demo</name>
+ <artifactId>portlet-bridge-guessNumber-jsp-mojarraWrapper</artifactId>
+ <packaging>war</packaging>
+
+ <parent>
+ <groupId>org.apache.myfaces.portlet-bridge</groupId>
+ <artifactId>portlet-bridge-examples</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ </parent>
+
+ <properties>
+ <mojarra.version>1.2_07</mojarra.version>
+ </properties>
+
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>portlet-bridge-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>portlet-bridge-impl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jdev-plugin</artifactId>
+ <groupId>org.apache.myfaces.trinidadbuild</groupId>
+ <configuration>
+ <libraries>
+ <library>JSP Runtime</library>
+ </libraries>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>pluto-assemble</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <warName>${pom.artifactId}-pluto-${pom.version}</warName>
+ <outputDirectory>${project.build.directory}/../../assembly/target/webapp</outputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- sets up the webapp for deployment to pluto 2.0 "mvn clean install -Ppluto" -->
+ <profile>
+ <id>pluto</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.portals.pluto</groupId>
+ <artifactId>maven-pluto-plugin</artifactId>
+ <version>2.0.0</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>assemble</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+<!-- sets up the webapp for deployment to pluto 2.0 (this is included as its the command in 1.0 for building to 2 - i.e. backwards compat) "mvn clean install -Ppluto2" -->
+ <profile>
+ <id>pluto2</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.portals.pluto</groupId>
+ <artifactId>maven-pluto-plugin</artifactId>
+ <version>2.0.0</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>assemble</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- To run jetty, issue "mvn clean -PjettyConfig jetty:run" -->
+ <profile>
+ <id>jettyConfig</id>
+ <dependencies>
+ <dependency>
+ <groupId>com.bekk.boss</groupId>
+ <artifactId>maven-jetty-pluto-embedded</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <configuration>
+ <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
+ <webDefaultXml>src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
+ <systemProperties>
+ <systemProperty>
+ <name>org.apache.pluto.embedded.portletIds</name>
+ <value>portlet-bridge-guessNumber-jsp-mojarraWrapper</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>maven-pluto-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- This test requires Mojarra:) -->
+
+ <!-- If you are running in a nonJavaEE environment (i.e. Faces isn't already deployed) and hence need to have Mojarra packaged in the war: -->
+ <profile>
+ <id>mojarra-nonjavaee</id>
+ <activation>
+ <property>
+ <name>!jsf</name>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>${mojarra.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>${mojarra.version}</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <jsf_implementation>JSF-RI</jsf_implementation>
+ </properties>
+ </profile>
+
+ <!-- If you are running in a JavaEE environment (i.e. Faces is already deployed) and hence don't need to have Mojarra packaged in the war: -->
+ <!-- mvn install -Djsf=mojarra-javaee -->
+ <profile>
+ <id>mojarra</id>
+ <activation>
+ <property>
+ <name>jsf</name>
+ <value>mojarra-javaee</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+ </dependencies>
+ <properties>
+ <jsf_implementation>JSF-RI</jsf_implementation>
+ </properties>
+ </profile>
+
+ </profiles>
+</project>
\ No newline at end of file
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/MessageFactory.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/MessageFactory.java?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/MessageFactory.java (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/MessageFactory.java Tue Jun 1 23:35:42 2010
@@ -0,0 +1,340 @@
+/*
+ * $Id: MessageFactory.java,v 1.6 2005/12/14 22:27:25 rlubke Exp $
+ */
+
+/*
+* The contents of this file are subject to the terms
+* of the Common Development and Distribution License
+* (the License). You may not use this file except in
+* compliance with the License.
+*
+* You can obtain a copy of the License at
+* https://javaserverfaces.dev.java.net/CDDL.html or
+* legal/CDDLv1.0.txt.
+* See the License for the specific language governing
+* permission and limitations under the License.
+*
+* When distributing Covered Code, include this CDDL
+* Header Notice in each file and include the License file
+* at legal/CDDLv1.0.txt.
+* If applicable, add the following below the CDDL Header,
+* with the fields enclosed by brackets [] replaced by
+* your own identifying information:
+* "Portions Copyrighted [year] [name of copyright owner]"
+*
+* [Name of File] [ver.__] [Date]
+*
+* Copyright 2005 Sun Microsystems Inc. All Rights Reserved
+*/
+
+package guessNumber;
+
+import javax.el.ValueExpression;
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+/**
+ * <p>supported filters: <code>package</code> and
+ * <code>protection</code>.</p>
+ */
+
+public class MessageFactory extends Object {
+ //
+ // Protected Constants
+ //
+
+ //
+ // Class Variables
+ //
+
+ //
+ // Instance Variables
+ //
+
+ // Attribute Instance Variables
+
+ // Relationship Instance Variables
+
+ //
+ // Constructors and Initializers
+ //
+
+ private MessageFactory() {
+ }
+
+ //
+ // Class methods
+ //
+
+ //
+ // General Methods
+ //
+
+ /**
+ * This version of getMessage() is used in the RI for localizing RI
+ * specific messages.
+ */
+
+ public static FacesMessage getMessage(String messageId, Object params[]) {
+ Locale locale = null;
+ FacesContext context = FacesContext.getCurrentInstance();
+ // context.getViewRoot() may not have been initialized at this point.
+ if (context != null && context.getViewRoot() != null) {
+ locale = context.getViewRoot().getLocale();
+ if (locale == null) {
+ locale = Locale.getDefault();
+ }
+ } else {
+ locale = Locale.getDefault();
+ }
+
+ return getMessage(locale, messageId, params);
+ }
+
+ public static FacesMessage getMessage(Locale locale, String messageId,
+ Object params[]) {
+ FacesMessage result = null;
+ String
+ summary = null,
+ detail = null,
+ bundleName = null;
+ ResourceBundle bundle = null;
+
+ // see if we have a user-provided bundle
+ if (null != (bundleName = getApplication().getMessageBundle())) {
+ if (null !=
+ (bundle =
+ ResourceBundle.getBundle(bundleName, locale,
+ getCurrentLoader(bundleName)))) {
+ // see if we have a hit
+ try {
+ summary = bundle.getString(messageId);
+ detail = bundle.getString(messageId + "_detail");
+ }
+ catch (MissingResourceException e) {
+ }
+ }
+ }
+
+ // we couldn't find a summary in the user-provided bundle
+ if (null == summary) {
+ // see if we have a summary in the app provided bundle
+ bundle = ResourceBundle.getBundle(FacesMessage.FACES_MESSAGES,
+ locale,
+ getCurrentLoader(bundleName));
+ if (null == bundle) {
+ throw new NullPointerException();
+ }
+ // see if we have a hit
+ try {
+ summary = bundle.getString(messageId);
+ detail = bundle.getString(messageId + "_detail");
+ }
+ catch (MissingResourceException e) {
+ }
+ }
+
+ // we couldn't find a summary anywhere! Return null
+ if (null == summary) {
+ return null;
+ }
+
+ if (null == summary || null == bundle) {
+ throw new NullPointerException(" summary " + summary + " bundle " +
+ bundle);
+ }
+ // At this point, we have a summary and a bundle.
+ //
+ return (new BindingFacesMessage(locale, summary, detail, params));
+ }
+
+
+ //
+ // Methods from MessageFactory
+ //
+ public static FacesMessage getMessage(FacesContext context,
+ String messageId) {
+ return getMessage(context, messageId, null);
+ }
+
+ public static FacesMessage getMessage(FacesContext context,
+ String messageId,
+ Object params[]) {
+ if (context == null || messageId == null) {
+ throw new NullPointerException(" context "
+ + context
+ + " messageId "
+ +
+ messageId);
+ }
+ Locale locale = null;
+ // viewRoot may not have been initialized at this point.
+ if (context != null && context.getViewRoot() != null) {
+ locale = context.getViewRoot().getLocale();
+ } else {
+ locale = Locale.getDefault();
+ }
+ if (null == locale) {
+ throw new NullPointerException(" locale " + locale);
+ }
+ FacesMessage message = getMessage(locale, messageId, params);
+ if (message != null) {
+ return message;
+ }
+ locale = Locale.getDefault();
+ return (getMessage(locale, messageId, params));
+ }
+
+ public static FacesMessage getMessage(FacesContext context,
+ String messageId,
+ Object param0) {
+ return getMessage(context, messageId, new Object[]{param0});
+ }
+
+ public static FacesMessage getMessage(FacesContext context,
+ String messageId,
+ Object param0, Object param1) {
+ return getMessage(context, messageId, new Object[]{param0, param1});
+ }
+
+ public static FacesMessage getMessage(FacesContext context,
+ String messageId,
+ Object param0, Object param1,
+ Object param2) {
+ return getMessage(context, messageId,
+ new Object[]{param0, param1, param2});
+ }
+
+ public static FacesMessage getMessage(FacesContext context,
+ String messageId,
+ Object param0, Object param1,
+ Object param2, Object param3) {
+ return getMessage(context, messageId,
+ new Object[]{param0, param1, param2, param3});
+ }
+
+ // Gets the "label" property from the component.
+
+ public static Object getLabel(FacesContext context,
+ UIComponent component) {
+ Object o = component.getAttributes().get("label");
+ if (o == null) {
+ o = component.getValueExpression("label");
+ }
+ // Use the "clientId" if there was no label specified.
+ if (o == null) {
+ o = component.getClientId(context);
+ }
+ return o;
+ }
+
+ protected static Application getApplication() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ if (context != null) {
+ return (FacesContext.getCurrentInstance().getApplication());
+ }
+ ApplicationFactory afactory = (ApplicationFactory)
+ FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ return (afactory.getApplication());
+ }
+
+ protected static ClassLoader getCurrentLoader(Object fallbackClass) {
+ ClassLoader loader =
+ Thread.currentThread().getContextClassLoader();
+ if (loader == null) {
+ loader = fallbackClass.getClass().getClassLoader();
+ }
+ return loader;
+ }
+
+ /**
+ * This class overrides FacesMessage to provide the evaluation
+ * of binding expressions in addition to Strings.
+ * It is often the case, that a binding expression may reference
+ * a localized property value that would be used as a
+ * substitution parameter in the message. For example:
+ * <code>#{bundle.userLabel}</code>
+ * "bundle" may not be available until the page is rendered.
+ * The "late" binding evaluation in <code>getSummary</code> and
+ * <code>getDetail</code> allow the expression to be evaluated
+ * when that property is available.
+ */
+ static class BindingFacesMessage extends FacesMessage {
+ BindingFacesMessage(
+ Locale locale,
+ String messageFormat,
+ String detailMessageFormat,
+ // array of parameters, both Strings and ValueExpressions
+ Object[] parameters) {
+
+ super(messageFormat, detailMessageFormat);
+ this.locale = locale;
+ this.parameters = parameters;
+ if (parameters != null) {
+ resolvedParameters = new Object[parameters.length];
+ }
+ }
+
+ public String getSummary() {
+ String pattern = super.getSummary();
+ resolveBindings();
+ return getFormattedString(pattern, resolvedParameters);
+ }
+
+ public String getDetail() {
+ String pattern = super.getDetail();
+ resolveBindings();
+ return getFormattedString(pattern, resolvedParameters);
+ }
+
+ private void resolveBindings() {
+ FacesContext context = null;
+ if (parameters != null) {
+ for (int i = 0; i < parameters.length; i++) {
+ Object o = parameters[i];
+ if (o instanceof ValueExpression) {
+ if (context == null) {
+ context = FacesContext.getCurrentInstance();
+ }
+ o = ((ValueExpression) o)
+ .getValue(context.getELContext());
+ }
+ // to avoid 'null' appearing in message
+ if (o == null) {
+ o = "";
+ }
+ resolvedParameters[i] = o;
+ }
+ }
+ }
+
+ private String getFormattedString(String msgtext, Object[] params) {
+ String localizedStr = null;
+
+ if (params == null || msgtext == null) {
+ return msgtext;
+ }
+ StringBuffer b = new StringBuffer(100);
+ MessageFormat mf = new MessageFormat(msgtext);
+ if (locale != null) {
+ mf.setLocale(locale);
+ b.append(mf.format(params));
+ localizedStr = b.toString();
+ }
+ return localizedStr;
+ }
+
+ private Locale locale;
+ private Object[] parameters;
+ private Object[] resolvedParameters;
+ }
+} // end of class MessageFactory
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/UserNumberBean.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/UserNumberBean.java?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/UserNumberBean.java (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/guessNumber/UserNumberBean.java Tue Jun 1 23:35:42 2010
@@ -0,0 +1,210 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the License at
+ * https://javaserverfaces.dev.java.net/CDDL.html or
+ * legal/CDDLv1.0.txt.
+ * See the License for the specific language governing
+ * permission and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at legal/CDDLv1.0.txt.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * [Name of File] [ver.__] [Date]
+ *
+ * Copyright 2005 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package guessNumber;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.LongRangeValidator;
+import javax.faces.validator.ValidatorException;
+
+import java.util.Random;
+
+
+public class UserNumberBean {
+
+ Integer userNumber = null;
+ Integer randomInt = null;
+ String response = null;
+
+
+ public UserNumberBean() {
+ Random randomGR = new Random();
+ do {
+ randomInt = new Integer(randomGR.nextInt(10));
+ } while (randomInt.intValue() == 0);
+ System.out.println("Duke's number: " + randomInt);
+ }
+
+
+ public void setUserNumber(Integer user_number) {
+ userNumber = user_number;
+ System.out.println("Set userNumber " + userNumber);
+ }
+
+
+ public Integer getUserNumber() {
+ System.out.println("get userNumber " + userNumber);
+ return userNumber;
+ }
+
+
+ public String getResponse() {
+
+ if (userNumber != null && userNumber.compareTo(randomInt) == 0) {
+ return "Yay! You got it!";
+ } else if (userNumber == null) {
+ return "Sorry, " + userNumber +
+ " is incorrect. Try a larger number.";
+ } else {
+ int num = userNumber.intValue();
+ if (num > randomInt.intValue()) {
+ return "Sorry, " + userNumber +
+ " is incorrect. Try a smaller number.";
+ } else {
+ return "Sorry, " + userNumber +
+ " is incorrect. Try a larger number.";
+ }
+ }
+ }
+
+
+ protected String[] status = null;
+
+
+ public String[] getStatus() {
+ return status;
+ }
+
+
+ public void setStatus(String[] newStatus) {
+ status = newStatus;
+ }
+
+
+ private int maximum = 0;
+ private boolean maximumSet = false;
+
+
+ public int getMaximum() {
+ return (this.maximum);
+ }
+
+
+ public void setMaximum(int maximum) {
+ this.maximum = maximum;
+ this.maximumSet = true;
+ }
+
+
+ private int minimum = 0;
+ private boolean minimumSet = false;
+
+
+ public int getMinimum() {
+ return (this.minimum);
+ }
+
+
+ public void setMinimum(int minimum) {
+ this.minimum = minimum;
+ this.minimumSet = true;
+ }
+
+
+ public void validate(FacesContext context,
+ UIComponent component,
+ Object value) throws ValidatorException {
+
+ if ((context == null) || (component == null)) {
+ throw new NullPointerException();
+ }
+ if (value != null) {
+ try {
+ int converted = intValue(value);
+ if (maximumSet &&
+ (converted > maximum)) {
+ if (minimumSet) {
+ throw new ValidatorException(
+ MessageFactory.getMessage
+ (context,
+ LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID,
+ new Object[]{
+ new Integer(minimum),
+ new Integer(maximum),
+ MessageFactory.getLabel(context,
+ component)
+ }));
+
+ } else {
+ throw new ValidatorException(
+ MessageFactory.getMessage
+ (context,
+ LongRangeValidator.MAXIMUM_MESSAGE_ID,
+ new Object[]{
+ new Integer(maximum),
+ MessageFactory.getLabel(context,
+ component)
+ }));
+ }
+ }
+ if (minimumSet &&
+ (converted < minimum)) {
+ if (maximumSet) {
+ throw new ValidatorException(MessageFactory.getMessage
+ (context,
+ LongRangeValidator.NOT_IN_RANGE_MESSAGE_ID,
+ new Object[]{
+ new Double(minimum),
+ new Double(maximum),
+ MessageFactory.getLabel(context, component)
+ }));
+
+ } else {
+ throw new ValidatorException(
+ MessageFactory.getMessage
+ (context,
+ LongRangeValidator.MINIMUM_MESSAGE_ID,
+ new Object[]{
+ new Integer(minimum),
+ MessageFactory.getLabel(context,
+ component)
+ }));
+ }
+ }
+ } catch (NumberFormatException e) {
+ throw new ValidatorException(
+ MessageFactory.getMessage
+ (context, LongRangeValidator.TYPE_MESSAGE_ID,
+ new Object[]{MessageFactory.getLabel(context,
+ component)}));
+ }
+ }
+
+ }
+
+
+ private int intValue(Object attributeValue)
+ throws NumberFormatException {
+
+ if (attributeValue instanceof Number) {
+ return (((Number) attributeValue).intValue());
+ } else {
+ return (Integer.parseInt(attributeValue.toString()));
+ }
+
+ }
+
+}
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/org/apache/myfaces/portlet/faces/application/BridgeMojarraResponseWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/org/apache/myfaces/portlet/faces/application/BridgeMojarraResponseWrapper.java?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/org/apache/myfaces/portlet/faces/application/BridgeMojarraResponseWrapper.java (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/java/org/apache/myfaces/portlet/faces/application/BridgeMojarraResponseWrapper.java Tue Jun 1 23:35:42 2010
@@ -0,0 +1,326 @@
+package org.apache.myfaces.portlet.faces.application;
+
+import com.sun.faces.application.InterweavingResponse;
+
+import java.io.ByteArrayOutputStream;
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Writer;
+
+import java.nio.ByteBuffer;
+
+import javax.faces.context.ExternalContext;
+
+import javax.faces.context.FacesContext;
+
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderResponse;
+import javax.portlet.faces.Bridge;
+import javax.portlet.faces.BridgeWriteBehindResponse;
+
+import javax.portlet.filter.RenderResponseWrapper;
+
+import javax.servlet.http.HttpServletResponse;
+
+
+public class BridgeMojarraResponseWrapper
+ extends RenderResponseWrapper
+ implements InterweavingResponse, BridgeWriteBehindResponse
+
+{
+
+ private DirectByteArrayServletOutputStream mByteStream;
+ private CharArrayWriter mCharWriter;
+ private PrintWriter mPrintWriter;
+ private int mStatus = HttpServletResponse.SC_OK;
+
+ public BridgeMojarraResponseWrapper()
+ {
+ super((RenderResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse());
+ }
+
+
+ public BridgeMojarraResponseWrapper(RenderResponse wrapped)
+ {
+ super(wrapped);
+ }
+
+ public void flushBuffer()
+ {
+ if (isChars())
+ {
+ mPrintWriter.flush();
+ }
+ }
+
+ public int getBufferSize()
+ {
+ if (isBytes())
+ {
+ return mByteStream.size();
+ }
+ else if (isChars())
+ {
+ return mCharWriter.size();
+ }
+ else
+ return 0;
+ }
+
+
+ public void reset()
+ {
+ super.reset();
+ if (isBytes())
+ {
+ mByteStream.reset();
+ }
+ else if (isChars())
+ {
+ mPrintWriter.flush();
+ mCharWriter.reset();
+ }
+ }
+
+ public void resetBuffer()
+ {
+ super.resetBuffer();
+ if (isBytes())
+ {
+ mByteStream.reset();
+ }
+ else if (isChars())
+ {
+ mPrintWriter.flush();
+ mCharWriter.reset();
+ }
+ }
+
+
+ public OutputStream getPortletOutputStream()
+ throws IOException
+ {
+ if (mPrintWriter != null)
+ {
+ throw new IllegalStateException();
+ }
+ if (mByteStream == null)
+ {
+ mByteStream = new DirectByteArrayServletOutputStream();
+ }
+ return mByteStream;
+ }
+
+ public PrintWriter getWriter()
+ throws IOException
+ {
+ if (mByteStream != null)
+ {
+ throw new IllegalStateException();
+ }
+ if (mPrintWriter == null)
+ {
+ mCharWriter = new CharArrayWriter(4096);
+ mPrintWriter = new PrintWriter(mCharWriter);
+ }
+
+ return mPrintWriter;
+ }
+
+ public int getStatus()
+ {
+ return mStatus;
+ }
+
+ public boolean isBytes()
+ {
+ return (mByteStream != null);
+ }
+
+ public boolean isChars()
+ {
+ return (mCharWriter != null);
+ }
+
+ public byte[] getBytes()
+ {
+ if (isBytes())
+ {
+ return mByteStream.toByteArray();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public char[] getChars()
+ {
+ if (isChars())
+ {
+ mCharWriter.flush();
+ return mCharWriter.toCharArray();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String toString()
+ {
+ if (isChars())
+ {
+ mCharWriter.flush();
+ return mCharWriter.toString();
+ }
+ else if (isBytes())
+ {
+ return mByteStream.toString();
+ }
+ else
+ return null;
+ }
+
+ public void clearWrappedResponse()
+ throws IOException
+ {
+ resetBuffers();
+ }
+
+ /**
+ * Flush the current buffered content to the wrapped
+ * response (this could be a Servlet or Portlet response)
+ * @throws IOException if content cannot be written
+ */
+ public void flushContentToWrappedResponse()
+ throws IOException
+ {
+ RenderResponse response = getResponse();
+
+ flushBuffer();
+
+ if (isBytes())
+ {
+ response.getPortletOutputStream().write(getBytes());
+ mByteStream.reset();
+ }
+ else if (isChars())
+ {
+ response.getWriter().write(getChars());
+ mCharWriter.reset();
+ }
+
+ }
+
+ /**
+ * Flush the current buffered content to the provided <code>Writer</code>
+ * @param writer target <code>Writer</code>
+ * @param encoding the encoding that should be used
+ * @throws IOException if content cannot be written
+ */
+ public void flushToWriter(Writer writer, String encoding)
+ throws IOException
+ {
+ flushBuffer();
+
+ if (isBytes())
+ {
+ throw new IOException("Invalid flushToWriter as the code is writing bytes to an OutputStream.");
+ }
+ else if (isChars())
+ {
+ writer.write(getChars());
+ mCharWriter.reset();
+ }
+ }
+
+ /**
+ * Clear the internal buffers.
+ * @throws IOException if some odd error occurs
+ */
+ public void resetBuffers()
+ throws IOException
+ {
+ if (isBytes())
+ {
+ mByteStream.reset();
+ }
+ else if (isChars())
+ {
+ mPrintWriter.flush();
+ mCharWriter.reset();
+ }
+ }
+
+
+ // ----------------------------------------------------------- Inner Classes
+
+
+ private class DirectByteArrayServletOutputStream
+ extends OutputStream
+ {
+ private DirectByteArrayOutputStream mByteArrayOutputStream;
+
+ public DirectByteArrayServletOutputStream()
+ {
+ mByteArrayOutputStream = new DirectByteArrayOutputStream(4096);
+ }
+
+ public void write(int n)
+ {
+ mByteArrayOutputStream.write(n);
+ }
+
+ public byte[] toByteArray()
+ {
+ return mByteArrayOutputStream.toByteArray();
+ }
+
+ public int size()
+ {
+ return mByteArrayOutputStream.size();
+ }
+
+ public void reset()
+ {
+ mByteArrayOutputStream.reset();
+ }
+
+ }
+
+
+ private class DirectByteArrayOutputStream
+ extends ByteArrayOutputStream
+ {
+
+
+ // -------------------------------------------------------- Constructors
+
+
+ public DirectByteArrayOutputStream(int initialCapacity)
+ {
+ super(initialCapacity);
+ }
+
+
+ // ------------------------------------------------------- PublicMethods
+
+
+ /**
+ * Return the buffer backing this ByteArrayOutputStream as a
+ * ByteBuffer.
+ * @return buf wrapped in a ByteBuffer
+ */
+ public ByteBuffer getByteBuffer()
+ {
+ return (ByteBuffer.wrap(buf, 0, count));
+ }
+
+ }
+
+
+ // end of class BridgeRenderFilterResponseWrapper
+}
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/resources/META-INF/NOTICE
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/resources/META-INF/NOTICE?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/resources/META-INF/NOTICE (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/resources/META-INF/NOTICE Tue Jun 1 23:35:42 2010
@@ -0,0 +1,20 @@
+Apache MyFaces Portlet Bridge
+Copyright [2007, 2008, 2009] The Apache Software Foundation
+
+This is an implementation of a public review specification
+developed under the Java Community Process (JCP). This
+implementation may not fully conform to this specification.
+This implementation may differ from the final specification.
+The code is not compatible with any specification of the JCP.
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software are Copyright (c) 2007, Oracle
+Corporation, <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/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/faces-config.xml?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/faces-config.xml (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/faces-config.xml Tue Jun 1 23:35:42 2010
@@ -0,0 +1,132 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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-config 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-facesconfig_1_2.xsd"
+ version="1.2">
+
+ <application>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>de</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>es</supported-locale>
+ </locale-config>
+ </application>
+
+ <navigation-rule>
+ <description>
+ The decision rule used by the NavigationHandler to
+ determine which view must be displayed after the
+ current view, greeting.jsp is processed.
+ </description>
+ <from-view-id>/greeting.jsp</from-view-id>
+ <navigation-case>
+ <description>
+ Indicates to the NavigationHandler that the response.jsp
+ view must be displayed if the Action referenced by a
+ UICommand component on the greeting.jsp view returns
+ the outcome "success".
+ </description>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/response.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <description>
+ The decision rules used by the NavigationHandler to
+ determine which view must be displayed after the
+ current view, response.jsp is processed.
+ </description>
+ <from-view-id>/response.jsp</from-view-id>
+ <navigation-case>
+ <description>
+ Indicates to the NavigationHandler that the greeting.jsp
+ view must be displayed if the Action referenced by a
+ UICommand component on the response.jsp view returns
+ the outcome "success".
+ </description>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/greeting.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <managed-bean>
+ <description>
+ The "backing file" bean that backs up the guessNumber webapp
+ </description>
+ <managed-bean-name>UserNumberBean</managed-bean-name>
+ <managed-bean-class>guessNumber.UserNumberBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>minimum</property-name>
+ <property-class>int</property-class>
+ <value>1</value>
+ </managed-property>
+ <managed-property>
+ <property-name>maximum</property-name>
+ <property-class>int</property-class>
+ <value>10</value>
+ </managed-property>
+
+ </managed-bean>
+
+ <managed-bean>
+ <description>
+ The "backing file" bean that backs up the guessNumber webapp
+ </description>
+ <managed-bean-name>requestBean</managed-bean-name>
+ <managed-bean-class>guessNumber.UserNumberBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>minimum</property-name>
+ <property-class>int</property-class>
+ <value>12</value>
+ </managed-property>
+ <managed-property>
+ <property-name>maximum</property-name>
+ <property-class>int</property-class>
+ <value>22</value>
+ </managed-property>
+
+ </managed-bean>
+
+
+</faces-config>
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml Tue Jun 1 23:35:42 2010
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+
+-->
+
+<!-- This web.xml file is used in order to configure pluto to run with jetty in order to test the appropriate web applications -->
+<web-app
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ metadata-complete="true"
+ version="2.5">
+
+ <context-param>
+ <param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
+ <param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
+ </context-param>
+
+ <!-- Listeners -->
+ <listener>
+ <listener-class>
+ com.bekk.boss.pluto.embedded.jetty.util.OverrideContextLoaderListener
+ </listener-class>
+ </listener>
+
+ <listener>
+ <listener-class>
com.bekk.boss.pluto.embedded.util.PortalStartupListener
+ </listener-class>
+ </listener>
+
+ <!-- Filters and Mappings -->
+ <filter>
+ <filter-name>plutoResourceFilter</filter-name>
+ <filter-class>com.bekk.boss.pluto.embedded.util.PlutResourcesFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>plutoPortalDriver</filter-name>
+ <filter-class>com.bekk.boss.pluto.embedded.util.PlutoPortalDriverFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>plutoResourceFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ <url-pattern>*.gif</url-pattern>
+ <url-pattern>*.png</url-pattern>
+ <url-pattern>*.js</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>plutoPortalDriver</filter-name>
+ <url-pattern>/pluto/index.jsp</url-pattern>
+ <url-pattern>/pluto/index.jsp/*</url-pattern>
+ </filter-mapping>
+
+ <!-- Servlets and Mappings -->
+
+ <!--
+ The default servlet.
+ This servlet, normally mapped to /, provides the handling for static
+ content, OPTIONS and TRACE methods for the context.
+ The following initParameters are supported:
+
+ acceptRanges If true, range requests and responses are
+ supported
+
+ dirAllowed If true, directory listings are returned if no
+ welcome file is found. Else 403 Forbidden.
+
+ redirectWelcome If true, redirect welcome file requests
+ else use request dispatcher forwards
+
+ gzip If set to true, then static content will be served
+ as gzip content encoded if a matching resource is
+ found ending with ".gz"
+
+ resoureBase Can be set to replace the context resource base
+
+ relativeResourceBase
+ Set with a pathname relative to the base of the
+ servlet context root. Useful for only serving
+ static content from only specific subdirectories.
+
+ useFileMappedBuffer
+ If set to true (the default), a memory mapped
+ file buffer will be used to serve static content
+ when using an NIO connector. Setting this value
+ to false means that a direct buffer will be used
+ instead. If you are having trouble with Windows
+ file locking, set this to false.
+
+ cacheControl If set, all static content will have this value
+ set as the cache-control header.
+
+ maxCacheSize Maximum size of the static resource cache
+
+ maxCachedFileSize Maximum size of any single file in the cache
+
+ maxCachedFiles Maximum number of files in the cache
+ -->
+
+ <servlet>
+ <servlet-name>default</servlet-name>
+ <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
+ <init-param>
+ <param-name>acceptRanges</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>dirAllowed</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>redirectWelcome</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCacheSize</param-name>
+ <param-value>4000000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCachedFileSize</param-name>
+ <param-value>254000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCachedFiles</param-name>
+ <param-value>1000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>gzip</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>useFileMappedBuffer</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet id="jsp">
+ <servlet-name>jsp</servlet-name>
+ <servlet-class>com.bekk.boss.pluto.embedded.util.PortletJspServlet</servlet-class>
+ <init-param>
+ <param-name>logVerbosityLevel</param-name>
+ <param-value>DEBUG</param-value>
+ </init-param>
+ <init-param>
+ <param-name>fork</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>xpoweredBy</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>default</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>jsp</servlet-name>
+ <url-pattern>*.jsp</url-pattern>
+ <url-pattern>*.jspf</url-pattern>
+ <url-pattern>*.jspx</url-pattern>
+ <url-pattern>*.xsp</url-pattern>
+ <url-pattern>*.JSP</url-pattern>
+ <url-pattern>*.JSPF</url-pattern>
+ <url-pattern>*.JSPX</url-pattern>
+ <url-pattern>*.XSP</url-pattern>
+ </servlet-mapping>
+
+ <!-- Other settings -->
+ <session-config>
+ <session-timeout>60</session-timeout>
+ </session-config>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <locale-encoding-mapping-list>
+ <locale-encoding-mapping><locale>ar</locale><encoding>ISO-8859-6</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>be</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>bg</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ca</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>cs</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>da</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>de</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>el</locale><encoding>ISO-8859-7</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>en</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>es</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>et</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>fi</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>fr</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>hr</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>hu</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>is</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>it</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>iw</locale><encoding>ISO-8859-8</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ja</locale><encoding>Shift_JIS</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ko</locale><encoding>EUC-KR</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>lt</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>lv</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>mk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>nl</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>no</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>pl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>pt</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ro</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ru</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sh</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sk</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sq</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sr</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sv</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>tr</locale><encoding>ISO-8859-9</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>uk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>zh</locale><encoding>GB2312</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>zh_TW</locale><encoding>Big5</encoding></locale-encoding-mapping>
+ </locale-encoding-mapping-list>
+</web-app>
+
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/portlet.xml?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/portlet.xml (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/portlet.xml Tue Jun 1 23:35:42 2010
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ id="BridgeGuessNumberMojarraWrapperDemo" version="2.0">
+
+
+ <portlet>
+ <description>Mojarra Guess Number Portlet</description>
+ <portlet-name>portlet-bridge-guessNumber-jsp-mojarraFilter</portlet-name>
+ <display-name>Mojarra Guess Number </display-name>
+ <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/greeting.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.bridgeWriteBehindResponseClassName</name>
+ <value>org.apache.myfaces.portlet.faces.application.BridgeMojarraResponseWrapper</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.excludedRequestAttributes</name>
+ <value>com.sun.faces.*, org.apache.myfaces.trinidad.*</value>
+ </init-param>
+
+ <supports>
+ <mime-type>application/xhtml+xml</mime-type>
+ <portlet-mode>view</portlet-mode>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+
+ <portlet-info>
+ <title>Mojarra Guess Number </title>
+ <short-title>Guess Number </short-title>
+ </portlet-info>
+
+ </portlet>
+
+
+</portlet-app>
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/web.xml?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/web.xml (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/WEB-INF/web.xml Tue Jun 1 23:35:42 2010
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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.
+-->
+
+<web-app>
+
+ <display-name>JavaServer Faces Guess Number Sample Application
+ </display-name>
+ <description>
+ JavaServer Faces Guess Number Sample Application
+ </description>
+
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+
+ <jsp-config>
+ <jsp-property-group>
+ <url-pattern>*.jsp</url-pattern>
+ <is-xml>true</is-xml>
+ </jsp-property-group>
+ </jsp-config>
+
+ <!-- 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>/guess/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <!-- This security constraint illustrates how JSP pages
+with JavaServer Faces components can be protected from
+being accessed without going through the Faces Servlet.
+The security constraint ensures that the Faces Servlet will
+be used or the pages will not be processed. -->
+ <display-name>Restrict access to JSP pages</display-name>
+ <web-resource-collection>
+ <web-resource-name>
+ Restrict access to JSP pages
+ </web-resource-name>
+ <url-pattern>/greeting.jsp</url-pattern>
+ <url-pattern>/response.jsp</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <description>
+ With no roles defined, no access granted
+ </description>
+ </auth-constraint>
+ </security-constraint>
+
+</web-app>
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/greeting.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/greeting.jsp?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/greeting.jsp (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/greeting.jsp Tue Jun 1 23:35:42 2010
@@ -0,0 +1,88 @@
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xml:lang="en" lang="en">
+<jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+<jsp:directive.page contentType="application/xhtml+xml; charset=UTF-8"/>
+<head>
+ <title>Hello</title>
+</head>
+<body bgcolor="white">
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0!" height="31" width="88"/></a>
+</p>
+
+<f:view>
+ <h:form id="helloForm">
+ <h2>Hi. My name is Duke. I'm thinking of a number from
+ <h:outputText lang="en_US" value="#{UserNumberBean.minimum}"/>
+ to
+ <h:outputText value="#{UserNumberBean.maximum}"/>
+ . Can you guess
+ it?
+ </h2>
+
+ <h:graphicImage id="waveImg" url="/wave.med.gif"/>
+ <h:inputText id="userNo" label="User Number"
+ value="#{UserNumberBean.userNumber}"
+ validator="#{UserNumberBean.validate}"/>
+ <h:commandButton id="submit" action="success" value="Submit"/>
+ <p/>
+ <h:message showSummary="true" showDetail="false"
+ style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique; text-decoration: overline"
+ id="errors1" for="userNo"/>
+
+ </h:form>
+</f:view>
+
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0!" height="31" width="88"/></a>
+</p>
+</body>
+</html>
+
+</jsp:root>
\ No newline at end of file
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/index.jsp?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/index.jsp (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/index.jsp Tue Jun 1 23:35:42 2010
@@ -0,0 +1,63 @@
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xml:lang="en" lang="en">
+<jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Trasitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+<jsp:directive.page contentType="application/xhtml+xml; charset=UTF-8"/>
+<head>
+</head>
+<body>
+
+<!--
+
+This page allows the user to go to the context-path and get redirected
+to the front page of the app. For example,
+http://localhost:8080/jsf-carstore/. Note that we use "*.jsf" as the
+page mapping. Doing so allows us to just name our pages as "*.jsp",
+refer to them as "*.jsf" and know that they will be properly picked up
+by the container.
+
+-->
+
+<jsp:forward page="guess/greeting.jsp"/>
+</body>
+</html>
+</jsp:root>
\ No newline at end of file
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/response.jsp
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/response.jsp?rev=950308&view=auto
==============================================================================
--- myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/response.jsp (added)
+++ myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/response.jsp Tue Jun 1 23:35:42 2010
@@ -0,0 +1,72 @@
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
+
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xml:lang="en" lang="en">
+<jsp:output doctype-root-element="html"
+ doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+ doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+<jsp:directive.page contentType="application/xhtml+xml; charset=UTF-8"/>
+<head>
+ <title>Guess The Number</title>
+</head>
+<body bgcolor="white">
+<f:view>
+ <h:form id="responseForm">
+ <h:graphicImage id="waveImg" url="/wave.med.gif"/>
+ <h2>
+ <h:outputText id="result" lang="en"
+ value="#{UserNumberBean.response}"/>
+ </h2>
+ <h:commandButton id="back" value="Back" action="success"/>
+ <p/>
+
+ </h:form>
+</f:view>
+
+<p>
+ <a href="http://validator.w3.org/check?uri=referer"><img
+ src="http://www.w3.org/Icons/valid-xhtml10"
+ alt="Valid XHTML 1.0!" height="31" width="88"/></a>
+</p>
+
+</body>
+</html>
+</jsp:root>
\ No newline at end of file
Added: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/wave.med.gif
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/wave.med.gif?rev=950308&view=auto
==============================================================================
Binary file - no diff available.
Propchange: myfaces/portlet-bridge/core/trunk_2.0.x/examples/guessNumberMojarraWrapper/src/main/webapp/wave.med.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream