You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2014/04/14 13:40:16 UTC

svn commit: r1587192 - in /myfaces/tobago/trunk/tobago-example: tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/ tobago-example-demo/src/main/webapp/WEB-INF/ tobago-example-demo/src/main/webapp/content/90-non-fa...

Author: lofwyr
Date: Mon Apr 14 11:40:16 2014
New Revision: 1587192

URL: http://svn.apache.org/r1587192
Log:
moving non-faces-request example to demo

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java
      - copied, changed from r1587158, myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishPond.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishServlet.java
      - copied, changed from r1587158, myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishServlet.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml
Removed:
    myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java (from r1587158, myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishPond.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java?p2=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java&p1=myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishPond.java&r1=1587158&r2=1587192&rev=1587192&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishPond.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishPond.java Mon Apr 14 11:40:16 2014
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.myfaces.tobago.example.nonfacesrequest;
+package org.apache.myfaces.tobago.example.demo.nonfacesrequest;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,7 +50,7 @@ public class FishPond {
 
     LOG.info("select via random: '" + selectedFish + "'");
 
-    return "view";
+    return "/content/90-non-faces-request/x-fish-pond.xhtml";
   }
 
   public String select(final String id) {
@@ -58,7 +58,7 @@ public class FishPond {
 
     LOG.info("select via id: '" + selectedFish + "'");
 
-    return "view";
+    return "/content/90-non-faces-request/x-fish-pond.xhtml";
   }
 
   public String getSelectedFish() {

Copied: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishServlet.java (from r1587158, myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishServlet.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishServlet.java?p2=myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishServlet.java&p1=myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishServlet.java&r1=1587158&r2=1587192&rev=1587192&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/java/org/apache/myfaces/tobago/example/nonfacesrequest/FishServlet.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/nonfacesrequest/FishServlet.java Mon Apr 14 11:40:16 2014
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.myfaces.tobago.example.nonfacesrequest;
+package org.apache.myfaces.tobago.example.demo.nonfacesrequest;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml?rev=1587192&r1=1587191&r2=1587192&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml Mon Apr 14 11:40:16 2014
@@ -249,6 +249,12 @@
     <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
 
+  <managed-bean>
+    <managed-bean-name>fishPond</managed-bean-name>
+    <managed-bean-class>org.apache.myfaces.tobago.example.demo.nonfacesrequest.FishPond</managed-bean-class>
+    <managed-bean-scope>session</managed-bean-scope>
+  </managed-bean>
+
   <navigation-rule>
     <navigation-case>
       <from-outcome>reference/intro</from-outcome>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml?rev=1587192&r1=1587191&r2=1587192&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml Mon Apr 14 11:40:16 2014
@@ -129,31 +129,46 @@
   </listener>
 -->
 
-  <!-- servlet -->
+  <!-- FacesServlet -->
+
   <servlet>
     <servlet-name>FacesServlet</servlet-name>
     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
     <load-on-startup>3</load-on-startup>
   </servlet>
 
+  <servlet-mapping>
+    <servlet-name>FacesServlet</servlet-name>
+    <url-pattern>/faces/*</url-pattern>
+  </servlet-mapping>
+
+  <!-- ResourceServlet -->
 
   <servlet>
     <servlet-name>ResourceServlet</servlet-name>
     <servlet-class>org.apache.myfaces.tobago.servlet.ResourceServlet</servlet-class>
   </servlet>
 
-  <!-- servlet-mapping -->
-
   <servlet-mapping>
-    <servlet-name>FacesServlet</servlet-name>
-    <url-pattern>/faces/*</url-pattern>
+    <servlet-name>ResourceServlet</servlet-name>
+    <url-pattern>/org/apache/myfaces/tobago/renderkit/*</url-pattern>
   </servlet-mapping>
 
+  <!-- Non-Faces-Request Demo -->
+
+  <servlet>
+    <servlet-name>FishServlet</servlet-name>
+    <servlet-class>org.apache.myfaces.tobago.example.demo.nonfacesrequest.FishServlet</servlet-class>
+    <load-on-startup>3</load-on-startup>
+  </servlet>
+
   <servlet-mapping>
-    <servlet-name>ResourceServlet</servlet-name>
-    <url-pattern>/org/apache/myfaces/tobago/renderkit/*</url-pattern>
+    <servlet-name>FishServlet</servlet-name>
+    <url-pattern>/FishServlet</url-pattern>
   </servlet-mapping>
 
+  <!-- Error Page -->
+
   <error-page>
     <error-code>404</error-code>
     <location>/faces/error/404.xhtml</location>

Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml?rev=1587192&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/non-faces-request.xhtml Mon Apr 14 11:40:16 2014
@@ -0,0 +1,39 @@
+<?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.
+-->
+
+<ui:composition template="/WEB-INF/tags/layout/overview.xhtml"
+                xmlns:tc="http://myfaces.apache.org/tobago/component"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core">
+    <ui:param name="title" value="Non-Faces-Request Demo: Start"/>
+
+    <tc:panel>
+        <p>
+            Use these external links:<br/>
+
+            <a href="#{request.contextPath}/FishServlet?id=0">#{request.contextPath}/FishServlet?id=0</a><br/>
+            <a href="#{request.contextPath}/FishServlet?id=1">#{request.contextPath}/FishServlet?id=1</a><br/>
+            <a href="#{request.contextPath}/FishServlet?id=2">#{request.contextPath}/FishServlet?id=2</a><br/>
+            <a href="#{request.contextPath}/FishServlet?id=3">#{request.contextPath}/FishServlet?id=3</a><br/>
+            <a href="#{request.contextPath}/FishServlet?id=4">#{request.contextPath}/FishServlet?id=4</a><br/>
+        </p>
+
+    </tc:panel>
+
+</ui:composition>

Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml?rev=1587192&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/90-non-faces-request/x-fish-pond.xhtml Mon Apr 14 11:40:16 2014
@@ -0,0 +1,44 @@
+<?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.
+-->
+
+<ui:composition template="/WEB-INF/tags/layout/overview.xhtml"
+                xmlns:tc="http://myfaces.apache.org/tobago/component"
+                xmlns:tx="http://myfaces.apache.org/tobago/extension"
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core">
+    <ui:param name="title" value="Non-Faces-Request Demo: Fish Pont"/>
+
+    <tc:panel>
+
+        <f:facet name="layout">
+            <tc:gridLayout rows="auto;auto" margin="20px"/>
+        </f:facet>
+
+        <tx:in label="Selected:" value="#{fishPond.selectedFish}" readonly="true"/>
+
+        <tc:panel>
+            <f:facet name="layout">
+                <tc:gridLayout columns="auto;*"/>
+            </f:facet>
+            <tc:button label="random" action="#{fishPond.random}"/>
+        </tc:panel>
+
+    </tc:panel>
+
+</ui:composition>