beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chad Schoettger" <chad.schoett...@gmail.com>
Subject servlet 2.5 api compat...
Date Fri, 28 Jul 2006 18:36:49 GMT
I've been playing around a bit with the 2.5 servlet api and Beehive,
just to get a feel for what has changed.  There isn't really all that
much that causes issues for Beehive at runtime, the only thing I have
found so far has been a difference in how ServletException and
JspException work in 2.5.

in the 2.4 servlet api, when you create a new ServletException:

ServletException se = new ServletException(throwable);

the ServletException superclass Throwable does not get its 'initCause'
method invoked.


In the 2.5 servlet api, it does.  There is code in Beehive which does
the following:

ServletException se = new ServletException(e);
se.initCause(e);

The second line causes an IllegalStateException in the servlet 2.5 api
since the cause has already been set via the constructor.  The same is
true for the JspException class.

Does anyone have an issue with me updating the affected Beehive
classes to correctly handle this case?  The change would consist of:

ServletException se = new ServletException(e);
try {
   se.initCause(e);
} catch (IllegalStateException ise) {
  // do nothing, just means 2.5 servlet api is being used.
}

At this point I'm not proposing we update the servlet api included in
the <beehive>/servlet/external directory to a 2.5 implementation, just
that we handle this case correctly for those users who may be
interested in running beehive on a server which has the 2.5 api.

The following classes would need to be modified:

<beehive>/trunk/netui/src/util/org/apache/beehive/netui/internal/ServletUtils
<beehive>/trunk/netui/src/tags-databinding/org/apache/beehive/netui/tags/databinding/ConfigurePager
<beehive>/trunk/netui/src/tags-htmll/org/apache/beehive/netui/tags/AbstractSimpleTag
<beehive>/trunk/netui/src/tags-htmll/org/apache/beehive/netui/tags/ErrorHandling
<beehive>/trunk/netui/src/tags-htmll/org/apache/beehive/netui/tags/HtmlUtils
<beehive>/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Attribute
<beehive>/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/IncludeSection
<beehive>/trunk/netui/src/tags-template/org/apache/beehive/netui/tags/template/Template



 - Thanks, Chad

Mime
View raw message