You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/05/27 00:16:45 UTC

svn commit: r178696 - in /incubator/beehive/trunk/netui: src/pageflow/org/apache/beehive/netui/pageflow/ test/webapps/drt/coreWeb/coretags/binding/report/ test/webapps/drt/testRecorder/tests/

Author: rich
Date: Thu May 26 15:16:43 2005
New Revision: 178696

URL: http://svn.apache.org/viewcvs?rev=178696&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-750 : default cancel action tried to set form attribute while the form object is null

tests: bvt in netui (WinXP)
BB: self (linux)


Added:
    incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java   (props changed)
      - copied unchanged from r171197, incubator/beehive/branches/rich-vnext/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java
Modified:
    incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/binding/report/index.jsp
    incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CtBindingReport.xml

Copied: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java (from r171197, incubator/beehive/branches/rich-vnext/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java)
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java?p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java&p1=incubator/beehive/branches/rich-vnext/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java&r1=171197&r2=178696&rev=178696&view=diff
==============================================================================
    (empty)

Propchange: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/NullActionForm.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java?rev=178696&r1=178695&r2=178696&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java (original)
+++ incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java Thu May 26 15:16:43 2005
@@ -121,6 +121,8 @@
     private static final String REDIRECT_REQUEST_ATTRS_PREFIX = InternalConstants.ATTR_PREFIX + "requestAttrs:";
     private static final String REDIRECT_REQUEST_ATTRS_PARAM = "forceRedirect";
     private static final String FLOW_CONTROLLER_ACTION_CLASSNAME = FlowControllerAction.class.getName();
+    private static final NullActionForm NULL_ACTION_FORM = new NullActionForm();
+
     
     private Map/*< String, Class >*/ _formBeanClasses = new HashMap/*< String, Class >*/();
     private Map/*< String, List< ActionMapping > >*/ _overloadedActions = new HashMap/*< String, List< ActionMapping > >*/();
@@ -379,6 +381,12 @@
         //
         if ( !alreadyCalledInRequest || form != null )
         {
+            //
+            // If this request was forwarded by a button-override of the main form action, then ensure that there are
+            // no databinding errors when the override action does not use a form bean.
+            //
+            if ( form == null && requestWrapper.isForwardedByButton() ) form = NULL_ACTION_FORM;
+
             ProcessPopulate.populate( request, response, form, alreadyCalledInRequest );
         }
     }

Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/binding/report/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/binding/report/index.jsp?rev=178696&r1=178695&r2=178696&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/binding/report/index.jsp (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/coretags/binding/report/index.jsp Thu May 26 15:16:43 2005
@@ -11,11 +11,11 @@
     <netui:body>
     <h4>Normal Error reporting by the BindingUpdateErrors tag</h4>
     <p style="color:green">This test will verify that BindingUpdateErrors report errors when binding errors
-    occur.  The way this happens is we post a form to an action that doesn't take a form.  The errors are
-    reported either based upon an expression or all the errors are reported.  Both cases are found below.
+    occur.  The way this happens is we use a form tag that posts to an action that doesn't take a form bean.
+    The errors are reported either based upon an expression or all the errors are reported.  Both cases are
+    found below.
     <br>
-    To run this test, you must fill in the form and then submit it.  When the form is submitted you will see the
-    errors displayed.
+    To run this test, you just hit the current page -- you will see the errors displayed.
     </p>
     <p>
     <ul>
@@ -25,11 +25,11 @@
     </ul>
     </p>
     <hr>
-    <netui:form action="postForm">
+    <netui:form action="begin">
     <p>
     Name <netui:textBox dataSource="actionForm.name" /><br>
     Type <netui:textBox dataSource="actionForm.type" /><br>
-    <netui:button value="Submit" action="begin"/>
+    <netui:button value="Submit"/>
     </p>
     </netui:form>
     </netui:body>

Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CtBindingReport.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CtBindingReport.xml?rev=178696&r1=178695&r2=178696&view=diff
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CtBindingReport.xml (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/CtBindingReport.xml Thu May 26 15:16:43 2005
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
    <ses:sessionName>CtBindingReport</ses:sessionName>
-   <ses:tester>Daryl</ses:tester>
-   <ses:startDate>11 Feb 2005, 06:22:03.201 PM MST</ses:startDate>
-   <ses:description>Daryl</ses:description>
+   <ses:tester>rich</ses:tester>
+   <ses:startDate>26 May 2005, 04:07:04.215 PM MDT</ses:startDate>
+   <ses:description>Normal errors reported by the BindingUpdateErrors tag.</ses:description>
    <ses:tests>
       <ses:test>
          <ses:testNumber>1</ses:testNumber>
@@ -18,159 +18,49 @@
             <ses:cookies>
                <ses:cookie>
                   <ses:name>JSESSIONID</ses:name>
-                  <ses:value>D816AF65DAC4C913C3202ED2A55FC180</ses:value>
+                  <ses:value>BCA7BC08EC3F8A8A81D0B47F32E2297C</ses:value>
                </ses:cookie>
-            </ses:cookies>
-            <ses:headers>
-               <ses:header>
-                  <ses:name>---------------</ses:name>
-                  <ses:value>----- -------</ses:value>
-               </ses:header>
-               <ses:header>
-                  <ses:name>accept</ses:name>
-                  <ses:value>image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*</ses:value>
-               </ses:header>
-               <ses:header>
-                  <ses:name>accept-language</ses:name>
-                  <ses:value>en-us</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>$Version=0; JSESSIONID=D816AF65DAC4C913C3202ED2A55FC180; $Path=/coreWeb</ses:value>
-               </ses:header>
-               <ses:header>
-                  <ses:name>host</ses:name>
-                  <ses:value>localhost:8080</ses:value>
-               </ses:header>
-               <ses:header>
-                  <ses:name>testrecorder.playback.testid</ses:name>
-                  <ses:value>f624cb5:102041cb937:-7b91</ses:value>
-               </ses:header>
-               <ses:header>
-                  <ses:name>user-agent</ses:name>
-                  <ses:value>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.40607)</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/coretags/binding/report/index.jsp">
-    </head>
-    <body>
-    <h4>Normal Error reporting by the BindingUpdateErrors tag</h4>
-    <p style="color:green">This test will verify that BindingUpdateErrors report errors when binding errors
-    occur.  The way this happens is we post a form to an action that doesn't take a form.  The errors are
-    reported either based upon an expression or all the errors are reported.  Both cases are found below.
-    <br>
-    To run this test, you must fill in the form and then submit it.  When the form is submitted you will see the
-    errors displayed.
-    </p>
-    <p>
-    <ul>
-    <li>actionForm.name -- </li>
-    <li>actionForm.type -- </li>
-    <li>all -- </li>
-    </ul>
-    </p>
-    <hr>
-    <form action="/coreWeb/coretags/binding/report/postForm.do" method="post">
-    <p>
-    Name <input type="text" name="{actionForm.name}"><br>
-    Type <input type="text" name="{actionForm.type}"><br>
-    <input type="submit" name="actionOverride:begin" value="Submit">
-    </p>
-    </form>
-    </body>
-
-</html>]]></ses:responseBody>
-         </ses:response>
-         <ses:testResults>
-            <ses:testStatus>fail</ses:testStatus>
-         </ses:testResults>
-      </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/coretags/binding/report/postForm.do</ses:uri>
-            <ses:method>POST</ses:method>
-            <ses:parameters>
-               <ses:parameter>
-                  <ses:name>actionOverride:begin</ses:name>
-                  <ses:value>Submit</ses:value>
-               </ses:parameter>
-               <ses:parameter>
-                  <ses:name>{actionForm.name}</ses:name>
-                  <ses:value>x</ses:value>
-               </ses:parameter>
-               <ses:parameter>
-                  <ses:name>{actionForm.type}</ses:name>
-                  <ses:value>x</ses:value>
-               </ses:parameter>
-            </ses:parameters>
-            <ses:cookies>
                <ses:cookie>
-                  <ses:name>JSESSIONID</ses:name>
-                  <ses:value>D816AF65DAC4C913C3202ED2A55FC180</ses:value>
+                  <ses:name>nde-textsize</ses:name>
+                  <ses:value>16px</ses:value>
                </ses:cookie>
             </ses:cookies>
             <ses:headers>
                <ses:header>
-                  <ses:name>---------------</ses:name>
-                  <ses:value>----- -------</ses:value>
-               </ses:header>
-               <ses:header>
                   <ses:name>accept</ses:name>
-                  <ses:value>image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*</ses:value>
+                  <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-language</ses:name>
-                  <ses:value>en-us</ses:value>
+                  <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>cache-control</ses:name>
-                  <ses:value>no-cache</ses:value>
+                  <ses:name>accept-encoding</ses:name>
+                  <ses:value>gzip,deflate</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>77</ses:value>
+                  <ses:name>accept-language</ses:name>
+                  <ses:value>en-us,en;q=0.5</ses:value>
                </ses:header>
                <ses:header>
-                  <ses:name>content-type</ses:name>
-                  <ses:value>application/x-www-form-urlencoded</ses:value>
+                  <ses:name>connection</ses:name>
+                  <ses:value>keep-alive</ses:value>
                </ses:header>
                <ses:header>
                   <ses:name>cookie</ses:name>
-                  <ses:value>$Version=0; JSESSIONID=D816AF65DAC4C913C3202ED2A55FC180; $Path=/coreWeb</ses:value>
+                  <ses:value>JSESSIONID=BCA7BC08EC3F8A8A81D0B47F32E2297C; nde-textsize=16px</ses:value>
                </ses:header>
                <ses:header>
                   <ses:name>host</ses:name>
                   <ses:value>localhost:8080</ses:value>
                </ses:header>
                <ses:header>
-                  <ses:name>testrecorder.playback.testid</ses:name>
-                  <ses:value>f624cb5:102041cb937:-7b91</ses:value>
+                  <ses:name>keep-alive</ses:name>
+                  <ses:value>300</ses:value>
                </ses:header>
                <ses:header>
                   <ses:name>user-agent</ses:name>
-                  <ses:value>Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 2.0.40607)</ses:value>
+                  <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4</ses:value>
                </ses:header>
             </ses:headers>
          </ses:request>
@@ -187,50 +77,45 @@
     <body>
     <h4>Normal Error reporting by the BindingUpdateErrors tag</h4>
     <p style="color:green">This test will verify that BindingUpdateErrors report errors when binding errors
-    occur.  The way this happens is we post a form to an action that doesn't take a form.  The errors are
-    reported either based upon an expression or all the errors are reported.  Both cases are found below.
+    occur.  The way this happens is we use a form tag that posts to an action that doesn't take a form bean.
+    The errors are reported either based upon an expression or all the errors are reported.  Both cases are
+    found below.
     <br>
-    To run this test, you must fill in the form and then submit it.  When the form is submitted you will see the
-    errors displayed.
+    To run this test, you just hit the current page -- you will see the errors displayed.
     </p>
     <p>
     <ul>
-    <li>actionForm.name -- <span style="color:red;background-color:white">
- [<b>Tag Error:1</b>, Found in tag <b>BindingUpdateErrors</b>]</span></li>
-    <li>actionForm.type -- <span style="color:red;background-color:white">
- [<b>Tag Error:2</b>, Found in tag <b>BindingUpdateErrors</b>]</span></li>
-    <li>all -- <span style="color:red;background-color:white">
- [<b>Tag Error:3</b>, Found in tag <b>BindingUpdateErrors</b>]</span></li>
+    <li>actionForm.name -- </li>
+    <li>actionForm.type -- </li>
+    <li>all -- </li>
     </ul>
     </p>
     <hr>
-    <form action="/coreWeb/coretags/binding/report/postForm.do" method="post">
+    <form action="/coreWeb/coretags/binding/report/begin.do" method="post">
     <p>
-    Name <input type="text" name="{actionForm.name}"><br>
-    Type <input type="text" name="{actionForm.type}"><br>
-    <input type="submit" name="actionOverride:begin" value="Submit">
+    Name <span style="color:red;background-color:white">
+ [<b>Expression Error:1</b>, Found in tag <b>TextBox</b>]</span><br>
+    Type <span style="color:red;background-color:white">
+ [<b>Expression Error:2</b>, Found in tag <b>TextBox</b>]</span><br>
+    <input type="submit" value="Submit">
     </p>
     </form>
     <div> <hr /><table border="1" cellspacing="0" style="color:red;background-color:white">
  <tr><th colspan="6">Page Errors</th></tr>
  <tr><th>Error Number</th><th>Tag Type</th><th colspan="4">Error</th></tr>
-<tr><th>1</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update Failed for 'actionForm.name', cause: Exception when attempting to update the expression "{actionForm.name}" with available binding contexts [actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException: Can not update the identifier "name" on a null value object.</td></tr>
-<tr><th>2</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update Failed for 'actionForm.type', cause: Exception when attempting to update the expression "{actionForm.type}" with available binding contexts [actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException: Can not update the identifier "type" on a null value object.</td></tr>
-<tr><th>3</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update Failed for '{actionForm.type}', cause: Exception when attempting to update the expression "{actionForm.type}" with available binding contexts [actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException: Can not update the identifier "type" on a null value object.</td></tr>
-<tr><th>4</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update Failed for '{actionForm.name}', cause: Exception when attempting to update the expression "{actionForm.name}" with available binding contexts [actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException: Can not update the identifier "name" on a null value object.</td></tr>
+<tr><th rowspan="2">1</th><th rowspan="2">TextBox</th><th>Attribute</th><td>dataSource</td>
+ <th>Expression</th><td>{actionForm.name}</td></tr>
+ <tr><th valign="top">Message</th><td colspan="3">Caught exception when evaluating expression "{actionForm.name}" with available binding contexts [actionForm, pageFlow, globalApp, request, session, application, pageContext, bundle, container, url, pageInput]. Root cause: java.lang.RuntimeException: Can not evaluate the identifier "name" on a null value object.</td></tr>
+<tr><th rowspan="2">2</th><th rowspan="2">TextBox</th><th>Attribute</th><td>dataSource</td>
+ <th>Expression</th><td>{actionForm.type}</td></tr>
+ <tr><th valign="top">Message</th><td colspan="3">Caught exception when evaluating expression "{actionForm.type}" with available binding contexts [actionForm, pageFlow, globalApp, request, session, application, pageContext, bundle, container, url, pageInput]. Root cause: java.lang.RuntimeException: Can not evaluate the identifier "type" on a null value object.</td></tr>
 </table></div>
 </body>
 
 </html>]]></ses:responseBody>
          </ses:response>
-         <ses:testResults>
-            <ses:testStatus>fail</ses:testStatus>
-         </ses:testResults>
       </ses:test>
    </ses:tests>
-   <ses:endDate>11 Feb 2005, 06:22:05.364 PM MST</ses:endDate>
-   <ses:sessionStatus>fail</ses:sessionStatus>
-   <ses:testCount>2</ses:testCount>
-   <ses:passedCount>0</ses:passedCount>
-   <ses:failedCount>2</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+   <ses:endDate>26 May 2005, 04:07:08.952 PM MDT</ses:endDate>
+   <ses:testCount>1</ses:testCount>
+</ses:recorderSession>