Author: rich
Date: Sat Feb 12 17:09:31 2005
New Revision: 153587

URL: http://svn.apache.org/viewcvs?view=rev&rev=153587
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-290 : UseFormBean fails to 
bind to the proper bean in some cases

DRT/BVT: netui (WinXP)
BB: self (linux)


Added:
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/index.jsp
   (with props)
    
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/SameBeanDifferentScope.xml
   (with props)
Modified:
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/FormBeanModel.java
    
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
    
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java?view=diff&r1=153586&r2=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenActionModel.java
 Sat Feb 12 17:09:31 2005
@@ -46,9 +46,10 @@
     {
         super( parentApp );
         
+        init( getActionName( sourceElement ), getActionAnnotation( 
sourceElement ), parentApp, jclass );
+        
         // Get the form class from the method argument.
         setFormBeanName( getFormBean( sourceElement, parentApp ) );
-        init( getActionName( sourceElement ), getActionAnnotation( 
sourceElement ), parentApp, jclass );
     }
     
     protected GenActionModel( String actionName, AnnotationMirror ann, 
GenStrutsApp parentApp, ClassDeclaration jclass )

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java?view=diff&r1=153586&r2=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
 Sat Feb 12 17:09:31 2005
@@ -161,7 +161,8 @@
         // See if the app already has a form-bean of this type.  If so,
         // we'll just use it; otherwise, we need to create it.
         //
-        FormBeanModel existingBean = getFormBeanByActualType( actualType );
+        boolean usesPageFlowScopedFormBean = usedByAction != null ? 
usedByAction.getFormMember() != null : false;
+        FormBeanModel existingBean = getFormBeanByActualType( actualType, 
usesPageFlowScopedFormBean );
         String formBeanName;
 
         if ( existingBean != null )
@@ -170,8 +171,8 @@
         }
         else
         {
-            formBeanName = getFormNameForType( actualType );
-            addFormBean( new FormBeanModel( formBeanName, formClass, 
actualType, this ) );
+            formBeanName = getFormNameForType( actualType, 
usesPageFlowScopedFormBean );
+            addFormBean( new FormBeanModel( formBeanName, formClass, 
actualType, usesPageFlowScopedFormBean, this ) );
             getMessageResourcesFromForm( formType, usedByAction );
         }
         

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java?view=diff&r1=153586&r2=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenValidationModel.java
 Sat Feb 12 17:09:31 2005
@@ -189,13 +189,13 @@
     private String getFormBeanName( TypeDeclaration beanType )
     {
         String actualType = CompilerUtils.getLoadableName( beanType );
-        FormBeanModel formBean = _strutsApp.getFormBeanByActualType( 
actualType );
+        FormBeanModel formBean = _strutsApp.getFormBeanByActualType( 
actualType, false );
 
         if ( formBean == null )
         {
             String beanClassName = CompilerUtils.getFormClassName( beanType, 
_strutsApp.getEnv() );
-            String formName = _strutsApp.getFormNameForType( actualType );
-            formBean = new FormBeanModel( formName, beanClassName, actualType, 
_strutsApp );
+            String formName = _strutsApp.getFormNameForType( actualType, false 
);
+            formBean = new FormBeanModel( formName, beanClassName, actualType, 
false, _strutsApp );
             _strutsApp.addFormBean( formBean );
         }
 

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/FormBeanModel.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/FormBeanModel.java?view=diff&r1=153586&r2=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/FormBeanModel.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/FormBeanModel.java
 Sat Feb 12 17:09:31 2005
@@ -95,16 +95,22 @@
     private boolean _dynamic = false;
     private String _name = null;  // required to be set
     private String _type = null;  // required to be set
+    
+    /** This is a NetUI-specific property. */ 
     private String _actualType = null;  // required to be set
+    
+    /** This is a NetUI-specific property. */ 
+    private boolean _pageFlowScoped;  // required to be set
 
     private ArrayList _properties = new ArrayList();
 
-    public FormBeanModel( String name, String type, String actualType, 
StrutsApp parent )
+    public FormBeanModel( String name, String type, String actualType, boolean 
pageFlowScoped, StrutsApp parent )
     {
         super( parent );
-        this._name = name;
-        this._type = type;
-        this._actualType = actualType;
+        _name = name;
+        _type = type;
+        _actualType = actualType;
+        _pageFlowScoped = pageFlowScoped;
     }
 
     public void writeToXMLBean( FormBeanDocument.FormBean xb )
@@ -274,5 +280,10 @@
     protected final List getPropertyList()
     {
         return ( List ) _properties.clone();
+    }
+
+    public boolean isPageFlowScoped()
+    {
+        return _pageFlowScoped;
     }
 }

Modified: 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java?view=diff&r1=153586&r2=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/model/StrutsApp.java
 Sat Feb 12 17:09:31 2005
@@ -224,12 +224,14 @@
         return _formBeans.get( formBeanName );
     }
 
-    public FormBeanModel getFormBeanByActualType( String actualTypeName )
+    public FormBeanModel getFormBeanByActualType( String actualTypeName, 
boolean usesPageFlowScopedFormBean )
     {
         for ( Iterator i = _formBeans.values().iterator(); i.hasNext(); )
         {
             FormBeanModel formBean = ( FormBeanModel ) i.next();
-            if ( formBean != null && formBean.getActualType().equals( 
actualTypeName ) )
+            
+            if ( formBean != null && formBean.getActualType().equals( 
actualTypeName )
+                 && usesPageFlowScopedFormBean == formBean.isPageFlowScoped() )
             {
                 return formBean;
             }
@@ -281,7 +283,7 @@
         return webappRoot;
     }
     
-    public String getFormNameForType( String formType )
+    public String getFormNameForType( String formType, boolean 
isPageFlowScoped )
     {
         //
         // First try and create a form-bean name that is a camelcased version 
of the classname without all of its
@@ -299,13 +301,24 @@
         if ( _formBeans.containsKey( formBeanName ) )
         {
             String conflictingName = formBeanName;
+            FormBeanModel conflictingBean = _formBeans.get( conflictingName );
+            
+            //
+            // If the conflicting form bean has a different value for 
isPageFlowScoped(), we can simply add a suffix
+            // to this bean name.
+            //
+            if ( conflictingBean != null && isPageFlowScoped != 
conflictingBean.isPageFlowScoped() )
+            {
+                formBeanName += isPageFlowScoped ? "_flowScoped" : 
"_nonFlowScoped";
+                assert ! _formBeans.containsKey( formBeanName );    // we 
generate this name -- shouldn't conflict
+                return formBeanName;
+            }
+            
             formBeanName = makeFullyQualifiedBeanName( formType );
             
             //
             // Now look for the one we're conflicting with 
             //
-            FormBeanModel conflictingBean = _formBeans.get( conflictingName );
-            
             if ( conflictingBean != null )
             {
                 String nonConflictingName = makeFullyQualifiedBeanName( 
conflictingBean.getType() );

Modified: 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java?view=diff&r1=153586&r2=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
 (original)
+++ 
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
 Sat Feb 12 17:09:31 2005
@@ -56,6 +56,8 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
 import java.util.concurrent.ConcurrentHashMap;
 
 import static org.apache.beehive.netui.pageflow.internal.InternalConstants.*;
@@ -75,8 +77,8 @@
     
     
     /** Map of Struts module prefix to Map of form-type-name to form-name. */
-    private static Map< String, Map< String, String > > _formNameMaps =
-            new ConcurrentHashMap< String, Map< String, String > >();
+    private static Map< String, Map< String, List< String > > > _formNameMaps =
+            new ConcurrentHashMap< String, Map< String, List< String > > >();
 
     
     /**
@@ -436,28 +438,37 @@
         }
     }
 
-    private static String getFormNameFromModuleConfig( String 
formBeanClassName, ModuleConfig moduleConfig )
+    private static List< String > getFormNamesFromModuleConfig( String 
formBeanClassName, ModuleConfig moduleConfig )
     {
         String modulePrefix = moduleConfig.getPrefix();
-        Map< String, String > formNameMap = _formNameMaps.get( modulePrefix ); 
 // map of form-type-name to form-name
+        Map< String, List< String > > formNameMap = _formNameMaps.get( 
modulePrefix );  // map of form-type-name to form-name
         
         if ( formNameMap == null )
         {
-            formNameMap = new HashMap< String, String >();
+            formNameMap = new HashMap< String, List< String > >();
             FormBeanConfig[] formBeans = moduleConfig.findFormBeanConfigs();
             
             for ( int j = 0; j < formBeans.length; ++j )
             {
                 assert formBeans[j] != null;
+                String formBeanType;
                 if ( formBeans[j] instanceof PageFlowActionFormBean )
                 {
-                    formNameMap.put( ( ( PageFlowActionFormBean ) formBeans[j] 
).getActualType(),
-                                     formBeans[j].getName() );
+                    formBeanType = ( ( PageFlowActionFormBean ) formBeans[j] 
).getActualType();
                 }
                 else
                 {
-                    formNameMap.put( formBeans[j].getType(), 
formBeans[j].getName() );
+                    formBeanType = formBeans[j].getType();
                 }
+                
+                List< String > formBeanNames = formNameMap.get( formBeanType );
+                if ( formBeanNames == null )
+                {
+                    formBeanNames = new ArrayList< String >();
+                    formNameMap.put( formBeanType, formBeanNames );
+                }
+                
+                formBeanNames.add( formBeans[j].getName() );
             }
             
             _formNameMaps.put( modulePrefix, formNameMap );
@@ -483,14 +494,26 @@
         {
             ModuleConfig moduleConfig = mapping.getModuleConfig();
             Class formClass = InternalUtils.unwrapFormBean( form ).getClass();
-            String formName = getFormNameFromModuleConfig( 
formClass.getName(), moduleConfig );
             
-            if ( formName == null )
+            //
+            // Get the names of *all* form beans of the desired type, and 
blast out this instance under all those names.
+            //
+            List< String > formNames = getFormNamesFromModuleConfig( 
formClass.getName(), moduleConfig );
+            
+            if ( formNames == null )
             {
-                formName = getFormBeanName( formClass, request, false );
+                String formName = generateFormBeanName( formClass, request );
+                InternalUtils.setFormInScope( formName, form, mapping, 
request, overwrite );
+            }
+            else
+            {
+                assert formNames.size() > 0;    // 
getFormNamesFromModuleConfig returns null or a nonempty list
+                
+                for ( String formName : formNames )
+                {
+                    InternalUtils.setFormInScope( formName, form, mapping, 
request, overwrite );
+                }
             }
-            
-            InternalUtils.setFormInScope( formName, form, mapping, request, 
overwrite );
         }
     }
     
@@ -509,7 +532,7 @@
      */ 
     public static String getFormBeanName( ActionForm formInstance, 
HttpServletRequest request )
     {
-        return getFormBeanName( formInstance, request, true );
+        return getFormBeanName( formInstance.getClass(), request );
     }
 
     /**
@@ -527,14 +550,22 @@
      */ 
     public static String getFormBeanName( Class formBeanClass, 
HttpServletRequest request )
     {
-        return getFormBeanName( formBeanClass, request, true );
+        ModuleConfig moduleConfig = RequestUtils.getRequestModuleConfig( 
request );
+        List< String > names = getFormNamesFromModuleConfig( 
formBeanClass.getName(), moduleConfig );
+        
+        if ( names != null )
+        {
+            assert names.size() > 0;    // getFormNamesFromModuleConfig 
returns null or a nonempty list
+            return names.get( 0 );
+        }
+        
+        return generateFormBeanName( formBeanClass, request );
     }
 
     /**
-     * Get the name for an ActionForm type.  Use a name looked up from the 
current Struts module, or,
-     * if none is found, create one.
+     * Create the name for a form bean type.
      * 
-     * @param formBeanClass the ActionForm-derived class whose type will 
determine the name.
+     * @param formBeanClass the class whose type will determine the name.
      * @param request the current HttpServletRequest, which contains a 
reference to the current Struts module.
      * @return the name found in the Struts module, or, if none is found, a 
name that is either:
      *     <ul>
@@ -543,17 +574,11 @@
      *         <li>the full class name, with '.' and '$' replaced by '_'.</li>
      *     </ul>
      */ 
-    private static String getFormBeanName( Class formBeanClass, 
HttpServletRequest request, boolean doStrutsLookup )
+    private static String generateFormBeanName( Class formBeanClass, 
HttpServletRequest request )
     {
         ModuleConfig moduleConfig = RequestUtils.getRequestModuleConfig( 
request );
         String formBeanClassName = formBeanClass.getName();
         
-        if ( doStrutsLookup )
-        {       
-            String name = getFormNameFromModuleConfig( formBeanClassName, 
moduleConfig );
-            if ( name != null ) return name;
-        }
-        
         //
         // A form-bean wasn't found for this type, so we'll create a name.  
First try and create
         // name that is a camelcased version of the classname without all of 
its package/outer-class
@@ -579,25 +604,6 @@
         return formName;        
     }
     
-    /**
-     * Get the name for the type of a ActionForm instance.  Use a name looked 
up from
-     * the current Struts module, or, if none is found, create one.
-     * 
-     * @param formInstance the ActionForm instance whose type will determine 
the name.
-     * @param request the current HttpServletRequest, which contains a 
reference to the current Struts module.
-     * @return the name found in the Struts module, or, if none is found, a 
name that is either:
-     *     <ul>
-     *         <li>a camel-cased version of the base class name (minus any 
package or outer-class
-     *             qualifiers, or, if that name is already taken,</li>
-     *         <li>the full class name, with '.' and '$' replaced by '_'.</li>
-     *     </ul>
-     */ 
-    private static String getFormBeanName( ActionForm formInstance, 
HttpServletRequest request,
-                                           boolean doStrutsLookup )
-    {
-        return getFormBeanName( formInstance.getClass(), request, 
doStrutsLookup );
-    }
-
     /**
      * Get the class name of a [EMAIL PROTECTED] PageFlowController}, given 
the URI to it.
      * 

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf?view=auto&rev=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf
 Sat Feb 12 17:09:31 2005
@@ -0,0 +1,44 @@
+package miniTests.sameBeanDifferentScope;
+
+import org.apache.beehive.netui.pageflow.*;
+import org.apache.beehive.netui.pageflow.annotations.*;
+
[EMAIL PROTECTED](
+    simpleActions={
+        @Jpf.SimpleAction(name="begin", path="index.jsp")
+    }
+)
+public class Controller extends PageFlowController
+{
+    private MyForm _myForm = new MyForm( "init val" );
+
+    @Jpf.Action(
+        useFormBean="_myForm",
+        forwards={
+            @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    public Forward withPageFlowScopedForm( MyForm form )
+    {
+        return new Forward( "index" );
+    }
+
+    @Jpf.Action(
+        forwards={
+            @Jpf.Forward(name="index", path="index.jsp")
+        }
+    )
+    public Forward withoutPageFlowScopedForm( MyForm form )
+    {
+        return new Forward( "index" );
+    }
+
+    public static class MyForm implements java.io.Serializable
+    {
+        private String _foo;
+        public MyForm() {}
+        public MyForm( String foo ) { _foo = foo; }
+        public void setFoo( String foo ) { _foo = foo; }
+        public String getFoo() { return _foo; }
+    }
+}

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/index.jsp
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/index.jsp?view=auto&rev=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/index.jsp
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/index.jsp
 Sat Feb 12 17:09:31 2005
@@ -0,0 +1,31 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+<%@ taglib prefix="netui-data" 
uri="http://beehive.apache.org/netui/tags-databinding-1.0"%>
+<%@ taglib prefix="netui-template" 
uri="http://beehive.apache.org/netui/tags-template-1.0"%>
+
+
+<netui:html>
+    <head>
+        <netui:base/>
+    </head>
+    <netui:body>
+        <h3>${pageFlow.URI}</h3>
+
+        Action <b>withoutPageFlowScopedForm</b> -- does not have the 
<code>useFormBean</code> attribute set.
+        <netui:form action="withoutPageFlowScopedForm">
+            foo: <netui:textBox dataSource="actionForm.foo"/>
+            <br/>
+            <netui:button value="submit"/>
+        </netui:form>
+
+        Action <b>withPageFlowScopedForm</b> -- does have the 
<code>useFormBean</code> attribute set.
+        <netui:form action="withPageFlowScopedForm">
+            foo: <netui:textBox dataSource="actionForm.foo"/>
+            <br/>
+            <netui:button value="submit"/>
+        </netui:form>
+    </netui:body>
+</netui:html>
+
+  
+

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/sameBeanDifferentScope/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/SameBeanDifferentScope.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/SameBeanDifferentScope.xml?view=auto&rev=153587
==============================================================================
--- 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/SameBeanDifferentScope.xml
 (added)
+++ 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/SameBeanDifferentScope.xml
 Sat Feb 12 17:09:31 2005
@@ -0,0 +1,303 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession 
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session";>
+   <ses:sessionName>SameBeanDifferentScope</ses:sessionName>
+   <ses:tester>rich</ses:tester>
+   <ses:startDate>12 Feb 2005, 03:46:09.967 PM MST</ses:startDate>
+   <ses:description>Test of two actions on the same page, both of which take 
the same type of form bean, but only one of which is "flow-scoped" (uses the 
'useFormBean' attribute on @Jpf.Action).</ses:description>
+   <ses:tests>
+      <ses:test>
+         <ses:testNumber>1</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf</ses:uri>
+            <ses:method>GET</ses:method>
+            <ses:parameters/>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>3CC8A795FBEE1B200C5DDE2A91E2A692</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=3CC8A795FBEE1B200C5DDE2A91E2A692</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+
+    <head>
+        <base 
href="http://localhost:8080/coreWeb/miniTests/sameBeanDifferentScope/index.jsp";>
+    </head>
+    <body>
+        <h3>/miniTests/sameBeanDifferentScope/Controller.jpf</h3>
+
+        Action <b>withoutPageFlowScopedForm</b> -- does not have the 
<code>useFormBean</code> attribute set.
+        <form 
action="/coreWeb/miniTests/sameBeanDifferentScope/withoutPageFlowScopedForm.do" 
method="post">
+            foo: <input type="text" name="{actionForm.foo}">
+            <br/>
+            <input type="submit" value="submit">
+        </form>
+
+        Action <b>withPageFlowScopedForm</b> -- does have the 
<code>useFormBean</code> attribute set.
+        <form 
action="/coreWeb/miniTests/sameBeanDifferentScope/withPageFlowScopedForm.do" 
method="post">
+            foo: <input type="text" name="{actionForm.foo}" value="init val">
+            <br/>
+            <input type="submit" value="submit">
+        </form>
+    </body>
+
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>2</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/miniTests/sameBeanDifferentScope/withPageFlowScopedForm.do</ses:uri>
+            <ses:method>POST</ses:method>
+            <ses:parameters>
+               <ses:parameter>
+                  <ses:name>{actionForm.foo}</ses:name>
+                  <ses:value>aaa</ses:value>
+               </ses:parameter>
+            </ses:parameters>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>3CC8A795FBEE1B200C5DDE2A91E2A692</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>content-length</ses:name>
+                  <ses:value>24</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>content-type</ses:name>
+                  <ses:value>application/x-www-form-urlencoded</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=3CC8A795FBEE1B200C5DDE2A91E2A692</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/miniTests/sameBeanDifferentScope/Controller.jpf</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+
+    <head>
+        <base 
href="http://localhost:8080/coreWeb/miniTests/sameBeanDifferentScope/index.jsp";>
+    </head>
+    <body>
+        <h3>/miniTests/sameBeanDifferentScope/Controller.jpf</h3>
+
+        Action <b>withoutPageFlowScopedForm</b> -- does not have the 
<code>useFormBean</code> attribute set.
+        <form 
action="/coreWeb/miniTests/sameBeanDifferentScope/withoutPageFlowScopedForm.do" 
method="post">
+            foo: <input type="text" name="{actionForm.foo}">
+            <br/>
+            <input type="submit" value="submit">
+        </form>
+
+        Action <b>withPageFlowScopedForm</b> -- does have the 
<code>useFormBean</code> attribute set.
+        <form 
action="/coreWeb/miniTests/sameBeanDifferentScope/withPageFlowScopedForm.do" 
method="post">
+            foo: <input type="text" name="{actionForm.foo}" value="aaa">
+            <br/>
+            <input type="submit" value="submit">
+        </form>
+    </body>
+
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+      <ses:test>
+         <ses:testNumber>3</ses:testNumber>
+         <ses:request>
+            <ses:protocol>HTTP</ses:protocol>
+            <ses:protocolVersion>1.1</ses:protocolVersion>
+            <ses:host>localhost</ses:host>
+            <ses:port>8080</ses:port>
+            
<ses:uri>/coreWeb/miniTests/sameBeanDifferentScope/withoutPageFlowScopedForm.do</ses:uri>
+            <ses:method>POST</ses:method>
+            <ses:parameters>
+               <ses:parameter>
+                  <ses:name>{actionForm.foo}</ses:name>
+                  <ses:value>bbb</ses:value>
+               </ses:parameter>
+            </ses:parameters>
+            <ses:cookies>
+               <ses:cookie>
+                  <ses:name>JSESSIONID</ses:name>
+                  <ses:value>3CC8A795FBEE1B200C5DDE2A91E2A692</ses:value>
+               </ses:cookie>
+            </ses:cookies>
+            <ses:headers>
+               <ses:header>
+                  <ses:name>accept</ses:name>
+                  
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-charset</ses:name>
+                  <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>content-length</ses:name>
+                  <ses:value>24</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>content-type</ses:name>
+                  <ses:value>application/x-www-form-urlencoded</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>cookie</ses:name>
+                  
<ses:value>JSESSIONID=3CC8A795FBEE1B200C5DDE2A91E2A692</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>host</ses:name>
+                  <ses:value>localhost:8080</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>referer</ses:name>
+                  
<ses:value>http://localhost:8080/coreWeb/miniTests/sameBeanDifferentScope/withPageFlowScopedForm.do</ses:value>
+               </ses:header>
+               <ses:header>
+                  <ses:name>user-agent</ses:name>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; 
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+               </ses:header>
+            </ses:headers>
+         </ses:request>
+         <ses:response>
+            <ses:statusCode>200</ses:statusCode>
+            <ses:reason/>
+            <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 
4.01 Transitional//EN"
+       "http://www.w3.org/TR/html4/loose.dtd";>
+<html lang="en">
+
+    <head>
+        <base 
href="http://localhost:8080/coreWeb/miniTests/sameBeanDifferentScope/index.jsp";>
+    </head>
+    <body>
+        <h3>/miniTests/sameBeanDifferentScope/Controller.jpf</h3>
+
+        Action <b>withoutPageFlowScopedForm</b> -- does not have the 
<code>useFormBean</code> attribute set.
+        <form 
action="/coreWeb/miniTests/sameBeanDifferentScope/withoutPageFlowScopedForm.do" 
method="post">
+            foo: <input type="text" name="{actionForm.foo}" value="bbb">
+            <br/>
+            <input type="submit" value="submit">
+        </form>
+
+        Action <b>withPageFlowScopedForm</b> -- does have the 
<code>useFormBean</code> attribute set.
+        <form 
action="/coreWeb/miniTests/sameBeanDifferentScope/withPageFlowScopedForm.do" 
method="post">
+            foo: <input type="text" name="{actionForm.foo}" value="aaa">
+            <br/>
+            <input type="submit" value="submit">
+        </form>
+    </body>
+
+</html>]]></ses:responseBody>
+         </ses:response>
+      </ses:test>
+   </ses:tests>
+   <ses:endDate>12 Feb 2005, 03:47:37.373 PM MST</ses:endDate>
+   <ses:testCount>3</ses:testCount>
+</ses:recorderSession>

Propchange: 
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/SameBeanDifferentScope.xml
------------------------------------------------------------------------------
    svn:eol-style = native


Reply via email to