Hello,
first, don't worry, you're on the right way... ;)
Zach Roberts wrote:
Hello Everyone,
I have been looking more at writing my own servlet to replace the
ChibaServlet, and I have reached a fair amount of success. However, I
still feel like there are some things I do not understand, and since
this is a vital part of my project I would really appreciate any insight
as to the gaps in my knowledge. Here goes my small brain-dump:
The org.chiba.adapter.EnvironmentAdapter calls for two methods that are
not documented very well, setForwardResponse() and setRedirectUri().
All that I can find about these methods is that they are used during the
doPost process which handles some specific cases of the XForm spec (I
think "<xforms:submission replace='all'/>" and "<xforms:load
show='replace'/>" from the code of the ChibaServlet). These methods are
in turn implemented by the org.chiba.adapter.web.WebAdapter
implementation of the EnvironmentAdapter interface. Also, the
WebAdapter stores a ChibaServlet specifically as a private variable, and
from what I can determine this is specifically to know that these two
methods exist in the private variable chibaServlet, and it is not
obvious as to me why this has been done. This creates a dependency for
the default servlet to be a ChibaServlet instead of a regular
HttpServlet. Now, in order to write a regular HttpServlet which
utilizes the ChibaBean, it must first comply with the ChibaServlet /
WebAdapter expectations, even if there is no reason for it to do that.
Also, it must completely replace the default ChibaServlet, and cannot
live next to it. It just feels like there ought to be a better (or more
abstracted) way to use the ChibaBean from any servlet.
Now, I am no java guru, but I am getting comfortable enough to be able
to modify the EnvironmentAdapter Interface, then update the WebAdapter
implementation to remove the two unknown methods and change the internal
variable from ChibaServlet to HttpServlet. Then, I am able to write my
own servlet which mimics most of the ChibaServlet functionality. So, I
guess the ultimate question I am asking is what am I breaking by doing
it this way? What do I lose when I get rid of those two methods from
the EnvironmentAdapter interface? And, if I am way off base in my
approach, can someone give me a simple shove in the right direction?
you analysis is quite good so far. i agree with you that the integration
of the servlet is not very good.
it always feels a bit like excuse but again this is understandable only
from the history of the project: initially the servlet was only written
to have a environment the processor lives in. so, not too much effort
was put into its design. since then, our minds are still focussed on the
core of the processor leaving some other parts of the code in the dust.
but i appreaciate this discussion as a chance to change this situation.
ok, now i try some facts...
uli + me also discussed the removal of the setForwardResponse() and
setRedirectUri() methods. these were introduced with chicoon 0.1 and
used for it. as a new chicoon is on the way, these methods may become
obsolete, but we've to check this with Andrzej who works on chicoon.
Uli, can you comment on this? are these methods still in use for Chiba?
as already stated i would be happy to change ChibaServlet references to
HttpServlet ones.
Joern
Thanks again for all the great work, and the help is always appreciated.
By the way, congrats on what looks to be a good 9.3 release!
Zach Roberts
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
|