You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2006/07/31 21:32:21 UTC
svn commit: r427226 - in /beehive/trunk/netui/src:
tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/
tags-html/org/apache/beehive/netui/tags/
tags-template/org/apache/beehive/netui/tags/template/
util/org/apache/beehive/netui/util/in...
Author: cschoett
Date: Mon Jul 31 12:32:21 2006
New Revision: 427226
URL: http://svn.apache.org/viewvc?rev=427226&view=rev
Log:
A minor change to ensure these classes work as expected with the servlet 2.5 api. Does not effect behavior
at runtime with the 2.4 api.
Modified:
beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java
beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Attribute.java
beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java
beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Template.java
beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/ServletUtils.java
Modified: beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java (original)
+++ beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/datagrid/ConfigurePager.java Mon Jul 31 12:32:21 2006
@@ -257,7 +257,13 @@
catch(DataGridExtensionException e) {
String msg = Bundle.getErrorString("ConfigurePager_CantCreateCustomPagerRenderer", new Object[]{e});
JspException jsp = new JspException(msg, e);
- jsp.initCause(e);
+
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jsp.getCause() == null) {
+ jsp.initCause(e);
+ }
throw jsp;
}
}
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractSimpleTag.java Mon Jul 31 12:32:21 2006
@@ -138,7 +138,13 @@
if (ctxt instanceof PageContext)
RequestUtils.saveException((PageContext) ctxt, e);
JspException jspException = new JspException(e.getMessage(), e);
- jspException.initCause(e);
+
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}
}
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/ErrorHandling.java Mon Jul 31 12:32:21 2006
@@ -131,7 +131,13 @@
}
catch (IOException e) {
JspException jspException = new JspException(e.getMessage(), e);
- jspException.initCause(e);
+
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}
}
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/HtmlUtils.java Mon Jul 31 12:32:21 2006
@@ -264,7 +264,13 @@
}
catch (UnsupportedEncodingException uee) {
JspException jspException = new JspException("Unsupported Encoding" + encoding, uee);
- jspException.initCause(uee);
+
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(uee);
+ }
throw jspException;
}
Modified: beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Attribute.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Attribute.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Attribute.java (original)
+++ beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Attribute.java Mon Jul 31 12:32:21 2006
@@ -195,7 +195,12 @@
catch (IOException e) {
localRelease();
JspException jspException = new JspException("Caught IO Exception:" + e.getMessage(),e);
- jspException.initCause(e);
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}
localRelease();
Modified: beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java (original)
+++ beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection.java Mon Jul 31 12:32:21 2006
@@ -244,8 +244,14 @@
new Object[]{"IOException",
reason});
logger.error(s);
+
JspException jspException = new JspException(s, e);
- jspException.initCause(e);
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}
// continue to evalue the page...(This should be a template)
@@ -288,7 +294,12 @@
_default});
logger.error(s,e);
JspException jspException = new JspException(s, e);
- jspException.initCause(e);
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}
catch (ServletException se) {
@@ -297,7 +308,12 @@
_default});
logger.error(s,se);
JspException jspException = new JspException(s, se);
- jspException.initCause(se);
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(se);
+ }
throw jspException;
}
}
@@ -317,7 +333,12 @@
_default});
logger.error(s,e);
JspException jspException = new JspException(s, e);
- jspException.initCause(e);
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}
}
Modified: beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Template.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Template.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Template.java (original)
+++ beehive/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Template.java Mon Jul 31 12:32:21 2006
@@ -391,7 +391,12 @@
realURI});
logger.error(s,e);
JspException jspException = new JspException(s, e);
- jspException.initCause(e);
+ // todo: future cleanup
+ // The 2.5 Servlet api will set the initCause in the Throwable superclass during construction,
+ // this will cause an IllegalStateException on the following call.
+ if (jspException.getCause() == null) {
+ jspException.initCause(e);
+ }
throw jspException;
}
}
Modified: beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/ServletUtils.java
URL: http://svn.apache.org/viewvc/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/ServletUtils.java?rev=427226&r1=427225&r2=427226&view=diff
==============================================================================
--- beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/ServletUtils.java (original)
+++ beehive/trunk/netui/src/util/org/apache/beehive/netui/util/internal/ServletUtils.java Mon Jul 31 12:32:21 2006
@@ -162,7 +162,13 @@
throws ServletException
{
ServletException servletException = new ServletException(cause);
- servletException.initCause(cause);
+
+ // todo: future cleanup
+ // the servlet 2.5 api sets does the equivalent of initCause in its constructor
+ // where the servlet 2.4 api does not, so check for the 2.5 behavior before setting initCause
+ if (servletException.getCause() == null) {
+ servletException.initCause(cause);
+ }
throw servletException;
}