Author: dolander
Date: Thu Sep 2 11:43:22 2004
New Revision: 37403
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/BindingUpdateErrors.xml
Log:
Put in some code to work around a bug in Tomcat where an internal error is
thrown when BodyContent.clearBody() is called.
The bug is due to the pooling of BodyContent objects. I haven't been able to
issolate a simple repo case to report
the bug back to Tomcat yet.
Update the results of BindingUpdateErrors which were out of date.
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/Repeater.java
Thu Sep 2 11:43:22 2004
@@ -553,8 +553,13 @@
{
super.localRelease();
- if(bodyContent != null)
- bodyContent.clearBody();
+ // This is a work around in Tomcat where clearBody() throwns an
internal exception
+ // because the BodyContent tag is pooled and under certain situtions
the pooled object has been
+ // flushed.
+ try {
+ if(bodyContent != null) bodyContent.clearBody();
+ }
+ catch (Exception ignore) {}
_currentItem = null;
_currentIndex = -1;
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterFooter.java
Thu Sep 2 11:43:22 2004
@@ -120,6 +120,13 @@
protected void localRelease()
{
super.localRelease();
- if(bodyContent != null) bodyContent.clearBody();
+
+ // This is a work around in Tomcat where clearBody() throwns an
internal exception
+ // because the BodyContent tag is pooled and under certain situtions
the pooled object has been
+ // flushed.
+ try {
+ if(bodyContent != null) bodyContent.clearBody();
+ }
+ catch (Exception ignore) {}
}
}
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterHeader.java
Thu Sep 2 11:43:22 2004
@@ -122,6 +122,14 @@
protected void localRelease()
{
super.localRelease();
- if(bodyContent != null) bodyContent.clearBody();
+
+ // This is a work around in Tomcat where clearBody() throwns an
internal exception
+ // because the BodyContent tag is pooled and under certain situtions
the pooled object has been
+ // flushed.
+ try {
+ if(bodyContent != null) bodyContent.clearBody();
+ }
+ catch (Exception ignore) {}
+
}
}
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/repeater/RepeaterItem.java
Thu Sep 2 11:43:22 2004
@@ -130,6 +130,13 @@
protected void localRelease()
{
super.localRelease();
- if(bodyContent != null) bodyContent.clearBody();
- }
+
+ // This is a work around in Tomcat where clearBody() throwns an
internal exception
+ // because the BodyContent tag is pooled and under certain situtions
the pooled object has been
+ // flushed.
+ try {
+ if(bodyContent != null) bodyContent.clearBody();
+ }
+ catch (Exception ignore) {}
+ }
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ErrorBaseTag.java
Thu Sep 2 11:43:22 2004
@@ -24,6 +24,7 @@
import org.apache.beehive.netui.tags.AbstractSimpleTag;
import org.apache.beehive.netui.tags.ExpressionHandling;
import org.apache.beehive.netui.util.logging.Logger;
+import org.apache.beehive.netui.util.Bundle;
import org.apache.struts.Globals;
import org.apache.struts.taglib.html.Constants;
import org.apache.struts.action.ActionError;
@@ -119,7 +120,6 @@
String message = null;
String key = report.getKey();
Object[] messageArgs = report.getValues();
- ExpressionHandling eh = new ExpressionHandling(this);
PageContext pageContext = getPageContext();
// First, replace expressions in all the message arguments.
@@ -178,6 +178,11 @@
}
else {
boolean requestedSpecificBundle = (bundle != null);
+ if (bundle == null && isMissingDefaultMessages(pageContext)) {
+ String s = Bundle.getString("Tags_ErrorsBundleMissing", null);
+ registerTagError(s, null);
+ return null;
+ }
// First look in the default message bundle for the page flow.
if (requestedSpecificBundle || !
isMissingDefaultMessages(pageContext))
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/netui.properties
Thu Sep 2 11:43:22 2004
@@ -96,6 +96,7 @@
Tags_formatDate_Type_Error=The type "{0}" may not be formatted by a formatDate
tag.
Tags_LocaleRequiresLanguage=If you set a country, you must also set a language
when specifying a local, defaulting to Locale of Request. The country set was
"{0}"
Tags_ErrorsException=An error occurred accessing the message bundle. This may
be because the message-resource is not defined within the page flow. The
error: {0}
+Tags_ErrorsBundleMissing=An error occurred accessing the message bundle. This
may be because the message-resource is not defined within the page flow. The
error: Cannot find message resources under key org.apache.struts.action.MESSAGE
Tags_ParameterRenderError=The parameter type [{0}] was not recognized as a
valid type.
Tags_ParameterAccessError=The parameter type [{0}] was not recognized as a
valid type, attempting to access argument ''{1}''.
Tags_DataSourceExpressionError=An error occurred converting the data source
"{0}" into an expression; {1}
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/BindingUpdateErrors.xml
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/BindingUpdateErrors.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/BindingUpdateErrors.xml
Thu Sep 2 11:43:22 2004
@@ -2,7 +2,7 @@
<ses:recorderSession
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
<ses:sessionName>BindingUpdateErrors</ses:sessionName>
<ses:tester>Daryl</ses:tester>
- <ses:startDate>24 Jul 2004, 05:33:48.522 PM MDT</ses:startDate>
+ <ses:startDate>02 Sep 2004, 10:52:54.657 AM MDT</ses:startDate>
<ses:description>Daryl</ses:description>
<ses:tests>
<ses:test>
@@ -15,7 +15,12 @@
<ses:uri>/coreWeb/tags/bindingUpdateErrors/Controller.jpf</ses:uri>
<ses:method>GET</ses:method>
<ses:parameters/>
- <ses:cookies/>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>941E27B2DA5B6E621FA18ED0DF8F05EB</ses:value>
+ </ses:cookie>
+ </ses:cookies>
<ses:headers>
<ses:header>
<ses:name>accept</ses:name>
@@ -34,6 +39,10 @@
<ses:value>Keep-Alive, TE</ses:value>
</ses:header>
<ses:header>
+ <ses:name>cookie</ses:name>
+ <ses:value>$Version=0;
JSESSIONID=941E27B2DA5B6E621FA18ED0DF8F05EB; $Path=/coreWeb</ses:value>
+ </ses:header>
+ <ses:header>
<ses:name>cookie2</ses:name>
<ses:value>$Version="1"</ses:value>
</ses:header>
@@ -47,7 +56,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>4b58bc9d:fdf37c62e7:-7ed2</ses:value>
+ <ses:value>-32aa562:fec006eb6a:-7ed2</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -101,7 +110,7 @@
</html>]]></ses:responseBody>
</ses:response>
<ses:testResults>
- <ses:testStatus>fail</ses:testStatus>
+ <ses:testStatus>pass</ses:testStatus>
</ses:testResults>
</ses:test>
<ses:test>
@@ -126,7 +135,7 @@
<ses:cookies>
<ses:cookie>
<ses:name>JSESSIONID</ses:name>
- <ses:value>072CEC0E6B8430204D6BA95538CB13F0</ses:value>
+ <ses:value>941E27B2DA5B6E621FA18ED0DF8F05EB</ses:value>
</ses:cookie>
</ses:cookies>
<ses:headers>
@@ -160,7 +169,7 @@
</ses:header>
<ses:header>
<ses:name>cookie</ses:name>
- <ses:value>$Version=0;
JSESSIONID=072CEC0E6B8430204D6BA95538CB13F0; $Path=/coreWeb</ses:value>
+ <ses:value>$Version=0;
JSESSIONID=941E27B2DA5B6E621FA18ED0DF8F05EB; $Path=/coreWeb</ses:value>
</ses:header>
<ses:header>
<ses:name>cookie2</ses:name>
@@ -176,7 +185,7 @@
</ses:header>
<ses:header>
<ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>4b58bc9d:fdf37c62e7:-7ed2</ses:value>
+ <ses:value>-32aa562:fec006eb6a:-7ed2</ses:value>
</ses:header>
<ses:header>
<ses:name>user-agent</ses:name>
@@ -222,27 +231,30 @@
<br/>
<input type="submit" value="postName">
<hr>
- <br>
- Errors for actionForm.firstName: <span
style="color:red;background-color:white">
+ <span style="color:red;background-color:white">
[<b>Tag Error:1</b>, Found in tag <b>BindingUpdateErrors</b>]</span><br>
+ Errors for actionForm.firstName: <span
style="color:red;background-color:white">
+ [<b>Tag Error:3</b>, Found in tag <b>BindingUpdateErrors</b>]</span><br>
Errors for actionForm.lastame: <span
style="color:red;background-color:white">
- [<b>Tag Error:2</b>, Found in tag <b>BindingUpdateErrors</b>]</span><br>
+ [<b>Tag Error:4</b>, Found in tag <b>BindingUpdateErrors</b>]</span><br>
</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.firstName', cause: Exception when attempting to update
the expression "{actionForm.firstName}" with available binding contexts
[actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException:
Could not update expression because a public field named "firstName" or setter
for the property "firstName" could not be found.</td></tr>
-<tr><th>2</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update
Failed for 'actionForm.lastName', cause: Exception when attempting to update
the expression "{actionForm.lastName}" with available binding contexts
[actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException:
Could not update expression because a public field named "lastName" or setter
for the property "lastName" could not be found.</td></tr>
+<tr><th>1</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update
Failed for '{actionForm.firstName}', cause: Exception when attempting to update
the expression "{actionForm.firstName}" with available binding contexts
[actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException:
Could not update expression because a public field named "firstName" or setter
for the property "firstName" could not be found.</td></tr>
+<tr><th>2</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update
Failed for '{actionForm.lastName}', cause: Exception when attempting to update
the expression "{actionForm.lastName}" with available binding contexts
[actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException:
Could not update expression because a public field named "lastName" or setter
for the property "lastName" could not be found.</td></tr>
+<tr><th>3</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update
Failed for 'actionForm.firstName', cause: Exception when attempting to update
the expression "{actionForm.firstName}" with available binding contexts
[actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException:
Could not update expression because a public field named "firstName" or setter
for the property "firstName" could not be found.</td></tr>
+<tr><th>4</th><th>BindingUpdateErrors</th><th>Message</th><td>Binding Update
Failed for 'actionForm.lastName', cause: Exception when attempting to update
the expression "{actionForm.lastName}" with available binding contexts
[actionForm, pageFlow, globalApp]. Root cause: java.lang.RuntimeException:
Could not update expression because a public field named "lastName" or setter
for the property "lastName" could not be found.</td></tr>
</table></div>
</body>
</html>]]></ses:responseBody>
</ses:response>
<ses:testResults>
- <ses:testStatus>pass</ses:testStatus>
+ <ses:testStatus>fail</ses:testStatus>
</ses:testResults>
</ses:test>
</ses:tests>
- <ses:endDate>24 Jul 2004, 05:33:50.175 PM MDT</ses:endDate>
+ <ses:endDate>02 Sep 2004, 10:52:56.159 AM MDT</ses:endDate>
<ses:sessionStatus>fail</ses:sessionStatus>
<ses:testCount>2</ses:testCount>
<ses:passedCount>1</ses:passedCount>