myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r416336 - in /myfaces/tomahawk/trunk/sandbox: core/src/main/resources-facesconfig/META-INF/ examples/src/main/java/org/apache/myfaces/examples/ examples/src/main/webapp/ examples/src/main/webapp/WEB-INF/ examples/src/main/webapp/redirectTra...
Date Thu, 22 Jun 2006 11:47:11 GMT
Author: imario
Date: Thu Jun 22 04:47:11 2006
New Revision: 416336

URL: http://svn.apache.org/viewvc?rev=416336&view=rev
Log:
RedirectTracker: a try to capture and restore - after a redirect - some request data, so that
it makes no difference if one uses the <redirect /> navigation configuration.

Currently tracked is:
Messages
Locale

Added:
    myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java
  (with props)
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp   (with
props)
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp   (with
props)
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp
  (with props)
Modified:
    myfaces/tomahawk/trunk/sandbox/core/src/main/resources-facesconfig/META-INF/faces-config.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
    myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp

Modified: myfaces/tomahawk/trunk/sandbox/core/src/main/resources-facesconfig/META-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/core/src/main/resources-facesconfig/META-INF/faces-config.xml?rev=416336&r1=416335&r2=416336&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/core/src/main/resources-facesconfig/META-INF/faces-config.xml
(original)
+++ myfaces/tomahawk/trunk/sandbox/core/src/main/resources-facesconfig/META-INF/faces-config.xml
Thu Jun 22 04:47:11 2006
@@ -78,7 +78,7 @@
      <component-type>org.apache.myfaces.Script</component-type>
      <component-class>org.apache.myfaces.custom.script.Script</component-class>
   </component>
-  
+
   <component>
     <component-type>org.apache.myfaces.AutoUpdateDataTable</component-type>
     <component-class>org.apache.myfaces.custom.autoupdatedatatable.AutoUpdateDataTable</component-class>
@@ -108,7 +108,7 @@
     <component-type>org.apache.myfaces.GraphicImageDynamic</component-type>
     <component-class>org.apache.myfaces.custom.graphicimagedynamic.GraphicImageDynamic</component-class>
   </component>
-  
+
   <component>
     <component-type>org.apache.myfaces.OutputLinkDynamic</component-type>
     <component-class>org.apache.myfaces.custom.outputlinkdynamic.OutputLinkDynamic</component-class>
@@ -154,12 +154,12 @@
 	<component-type>org.apache.myfaces.SelectOneRow</component-type>
 	<component-class>org.apache.myfaces.custom.selectOneRow.SelectOneRow</component-class>
   </component>
-  
+
   <component>
 	<component-type>org.apache.myfaces.DojoInitializer</component-type>
 	<component-class>org.apache.myfaces.custom.dojo.DojoInitializer</component-class>
   </component>
-  
+
   <component>
 	<component-type>org.apache.myfaces.StateChangedNotifier</component-type>
 	<component-class>org.apache.myfaces.custom.statechangednotifier.StateChangedNotifier</component-class>
@@ -169,7 +169,7 @@
     <component-type>org.apache.myfaces.IfMessage</component-type>
     <component-class>org.apache.myfaces.custom.ifmessage.IfMessage</component-class>
   </component>
-  
+
   <component>
   	<component-type>org.apache.myfaces.FishEyeList</component-type>
   	<component-class>org.apache.myfaces.custom.fisheye.HtmlFishEyeNavigationMenu</component-class>
@@ -195,8 +195,8 @@
   <converter>
     <converter-id>org.apache.myfaces.custom.convertStringUtils.StringUtilsConverter</converter-id>
     <converter-class>org.apache.myfaces.custom.convertStringUtils.StringUtilsConverter</converter-class>
-  </converter> 
-	
+  </converter>
+
   <converter>
      <converter-id>org.apache.myfaces.custom.convertDateTime.DateTimeConverter</converter-id>
      <converter-class>org.apache.myfaces.custom.convertDateTime.DateTimeConverter</converter-class>
@@ -324,7 +324,7 @@
        <renderer-type>org.apache.myfaces.GraphicImageDynamicRenderer</renderer-type>
        <renderer-class>org.apache.myfaces.custom.graphicimagedynamic.GraphicImageDynamicRenderer</renderer-class>
     </renderer>
-    
+
     <renderer>
        <component-family>javax.faces.Output</component-family>
        <renderer-type>org.apache.myfaces.OutputLinkDynamicRenderer</renderer-type>
@@ -368,7 +368,7 @@
         <renderer-class>org.apache.myfaces.custom.statechangednotifier.StateChangedNotifierRenderer</renderer-class>
     </renderer>
 
-    
+
 
     <renderer>
         <component-family>javax.faces.Panel</component-family>
@@ -398,8 +398,13 @@
   <lifecycle>
       <phase-listener>org.apache.myfaces.custom.ajax.api.AjaxDecodePhaseListener</phase-listener>
   	  <phase-listener>org.apache.myfaces.custom.valueChangeNotifier.ValueChangePhaseListener</phase-listener>
+	  <phase-listener>org.apache.myfaces.custom.redirectTracker.RedirectTrackerPhaseListener</phase-listener>
   </lifecycle>
-  
+
+  <factory>
+    <faces-context-factory>org.apache.myfaces.custom.redirectTracker.RedirectTrackerFacesContextFactory</faces-context-factory>
+  </factory>
+
   <!--custom validators -->
   <validator>
       <validator-id>org.apache.myfaces.validator.Url</validator-id>
@@ -414,5 +419,5 @@
       <validator-id>org.apache.myfaces.validator.CompareTo</validator-id>
       <validator-class>org.apache.myfaces.custom.comparetovalidator.CompareToValidator</validator-class>
   </validator>
-	
+
 </faces-config>

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java?rev=416336&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java
(added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java
Thu Jun 22 04:47:11 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.examples;
+
+import javax.faces.context.FacesContext;
+import javax.faces.application.FacesMessage;
+
+public class RequestTrackerRedirectBean
+{
+	public String redirectAction()
+	{
+		FacesContext.getCurrentInstance().addMessage(null,
+			new FacesMessage(FacesMessage.SEVERITY_INFO, "requestTrackerRedirect message", "this is
the message from the previous http request"));
+		
+		return "requestTrackerRedirect";
+	}
+}

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/java/org/apache/myfaces/examples/RequestTrackerRedirectBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml?rev=416336&r1=416335&r2=416336&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/WEB-INF/examples-config.xml Thu
Jun 22 04:47:11 2006
@@ -74,7 +74,7 @@
         <managed-bean-class>org.apache.myfaces.examples.ajaxchildcombobox.AjaxChildComboBoxBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
     </managed-bean>
-    
+
   <managed-bean>
     <managed-bean-name>userHandler</managed-bean-name>
     <managed-bean-class>org.apache.myfaces.examples.inputsuggest.UserHandler</managed-bean-class>
@@ -305,13 +305,13 @@
     <managed-bean-class>org.apache.myfaces.examples.graphicImageDynamic.GraphicImageDynamicBean</managed-bean-class>
     <managed-bean-scope>application</managed-bean-scope>
   </managed-bean>
-  
+
   <managed-bean>
     <managed-bean-name>graphicImageDynamicTextBean</managed-bean-name>
     <managed-bean-class>org.apache.myfaces.examples.graphicImageDynamic.GraphicImageDynamicTextBean</managed-bean-class>
     <managed-bean-scope>request</managed-bean-scope>
   </managed-bean>
-  
+
   <!-- managed bean for outputLinkDynamic -->
 
   <managed-bean>
@@ -409,7 +409,7 @@
 		<managed-bean-class>org.apache.myfaces.examples.dateTimeConverter.DateTimeConverterBean</managed-bean-class>
 		<managed-bean-scope>session</managed-bean-scope>
 	</managed-bean>
-	
+
 	<managed-bean>
 		<managed-bean-name>fisheye</managed-bean-name>
 		<managed-bean-class>org.apache.myfaces.examples.fisheye.FishEyeHandler</managed-bean-class>
@@ -433,7 +433,7 @@
 		<managed-bean-class>org.apache.myfaces.examples.conversation.WizardController</managed-bean-class>
 		<managed-bean-scope>request</managed-bean-scope>
 	</managed-bean>
-	
+
     <managed-bean>
     	<managed-bean-name>numberHolder</managed-bean-name>
     	<managed-bean-class>org.apache.myfaces.examples.NumberHolder</managed-bean-class>
@@ -447,7 +447,14 @@
     	<managed-bean-scope>request</managed-bean-scope>
     </managed-bean>
 
-    <!-- navigation rules -->
+	<!-- redirect tracker -->
+	<managed-bean>
+		<managed-bean-name>requestTrackerRedirectBean</managed-bean-name>
+		<managed-bean-class>org.apache.myfaces.examples.RequestTrackerRedirectBean</managed-bean-class>
+		<managed-bean-scope>request</managed-bean-scope>
+	</managed-bean>
+
+	<!-- navigation rules -->
     <navigation-rule>
 		<navigation-case>
 			<from-outcome>home</from-outcome>
@@ -456,7 +463,16 @@
 		</navigation-case>
 	</navigation-rule>
 
-    <!-- conversation -->
+	<!-- redirect tracker -->
+	<navigation-rule>
+		<navigation-case>
+			<from-outcome>requestTrackerRedirect</from-outcome>
+			<to-view-id>/redirectTracker/requestTrackerRedirect.jsp</to-view-id>
+			<redirect />
+		</navigation-case>
+	</navigation-rule>
+	
+	<!-- conversation -->
 	<navigation-rule>
 		<navigation-case>
 			<from-outcome>saveMe</from-outcome>
@@ -494,7 +510,7 @@
 			<redirect/>
 		</navigation-case>
 	</navigation-rule>
-	
+
     <!-- navigational rules for the wizard -->
 	<navigation-rule>
 		<from-view-id>/*</from-view-id>

Modified: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp?rev=416336&r1=416335&r2=416336&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp (original)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/home.jsp Thu Jun 22 04:47:11 2006
@@ -36,7 +36,7 @@
 
 	            <h:outputLink value="dateTimeConverter.jsf"><f:verbatim>DateTimeConverter
- a datetime converter that uses system timezone as default</f:verbatim></h:outputLink>
 	            <h:outputLink value="valueChangeNotifier.jsf"><f:verbatim>valueChangeNotifier
- Calls a custom valueChangeEvent method during MODEL_UPDATE Phase of the Faces Lifecycle</f:verbatim></h:outputLink>
-	            
+
 	            <h:outputText value="Validation"/>
 	            <h:panelGrid style="padding-left:25px">
 	            	<h:outputLink value="validateUrl.jsf" ><f:verbatim>Validation example
2 - including URL validator</f:verbatim></h:outputLink>
@@ -59,7 +59,7 @@
                 <h:outputLink value="inputAjax.jsf" ><f:verbatim>AJAX Form Components
- server side validation through ajax </f:verbatim></h:outputLink>
 	            <h:outputLink value="inputSuggest.jsf" ><f:verbatim>Input Suggest
- Suggest without Ajax</f:verbatim></h:outputLink>
             </h:panelGrid>
-            
+
             <h:outputText value="Data Tables"/>
             <h:panelGrid style="padding-left:25px">
             	<h:outputLink value="autoUpdateDataTable.jsf" ><f:verbatim>Automatically
updated dataTable per AJAX</f:verbatim></h:outputLink>
@@ -75,7 +75,7 @@
             <h:panelGrid style="padding-left:25px">
                <h:outputLink value="ifMessage.jsf"><f:verbatim>ifMessage - renders
its children only if there is a message in the FacesContext for the specified component(s)</f:verbatim></h:outputLink>
             </h:panelGrid>
-            
+
             <h:outputText value="FishEye Navigation"/>
             <h:panelGrid style="padding-left:25px">
                <h:outputLink value="fisheye.jsf"><f:verbatim>fishEyeNavigationMenu
- the Dojo Toolkit FishEye widget</f:verbatim></h:outputLink>
@@ -88,7 +88,7 @@
 	            <h:outputLink value="dojo/textareatestjsfonly.jsf"><f:verbatim>Integration
of Dojo Toolkit</f:verbatim></h:outputLink>
                 <h:outputLink value="killSession.jsf"><f:verbatim>Kill Session
- refreshes state</f:verbatim></h:outputLink>
                 <h:outputLink value="typedNumberConvert.jsf"><f:verbatim>automatically
convert the number to the correct type</f:verbatim></h:outputLink>
-                
+
             </h:panelGrid>
             <h:panelGrid style="padding-left:25px">
                 <h:outputLink value="ajaxChildComboBox.jsf" >
@@ -101,7 +101,12 @@
            		<h:outputLink value="conversation/index.jsf" ><f:verbatim>Conversation
Tag examples</f:verbatim></h:outputLink>
             </h:panelGrid>
 
-            <h:outputText value="XML Template"/>
+			<h:outputText value="Redirect Tracker"/>
+			<h:panelGrid style="padding-left:25px">
+				   <h:outputLink value="redirectTracker/index.jsf" ><f:verbatim>Redirect
Tracker - tries to capture the current request state and reset it after a redirect</f:verbatim></h:outputLink>
+			</h:panelGrid>
+
+			<h:outputText value="XML Template"/>
             <h:panelGrid style="padding-left:25px">
            		<h:outputLink value="template/index.jsf" ><f:verbatim>XML Template
examples</f:verbatim></h:outputLink>
             </h:panelGrid>
@@ -109,6 +114,6 @@
         </h:panelGrid>
     </h:form>
     </f:view>
-   
+
 </body>
 </html>

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp?rev=416336&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp Thu Jun
22 04:47:11 2006
@@ -0,0 +1,20 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+
+<html>
+
+    <%@include file="/inc/head.inc" %>
+<body>
+    <f:view>
+		<h:form>
+
+			Press the button to issue a redirect navigation request and see how the messages will
survive.
+
+			<h:commandButton value="Press Me" action="#{requestTrackerRedirectBean.redirectAction}"
/>
+			
+		</h:form>
+	</f:view>
+</body>
+</html>

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/home.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp?rev=416336&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp (added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp Thu
Jun 22 04:47:11 2006
@@ -0,0 +1,4 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%
+response.sendRedirect("home.jsf");
+%>
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/index.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp?rev=416336&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp
(added)
+++ myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp
Thu Jun 22 04:47:11 2006
@@ -0,0 +1,20 @@
+<%@ page session="false" contentType="text/html;charset=utf-8"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
+
+<html>
+
+    <%@include file="/inc/head.inc" %>
+<body>
+    <f:view>
+
+		Damn cool, isnt it?
+
+		<f:verbatim><hr /></f:verbatim>
+
+		<h:messages globalOnly="false" showDetail="true" showSummary="true"/>
+
+	</f:view>
+</body>
+</html>

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/sandbox/examples/src/main/webapp/redirectTracker/requestTrackerRedirect.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message