cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Engelhart <>
Subject Re: RequestDispatcher &
Date Thu, 03 Feb 2000 16:27:24 GMT
Donald Ball wrote:

> +1 from me, I'll go ahead and patch this since no one seems to have been
> bothered by it yet and it works for me on apache-jserv.
> - donald
Wait!  don't patch this as it only works for static page dispatches. If you
try this;

    RequestDispatcher rd =
    rd.forward(request, response);
    // document = null;
     // return;

The half processed originating page shows up after the dispatched page in
your browser.  REmoving the comments from the above code causes null pointer
exceptions (sometimes) and other extraneous errors.  Do not patch!!!! :-)

Here's my feelings about this.
I love XSP for generating dynamic content.  For embedding business logic or
handling servlet type activities it either doesn't work at all or is not
logical.  I think the XSP engine is too far down in the processing chain to
reliably handle things like RequestDispatcher's.  A RequestDispatcher is
designed to wrap a servlet not a Producer of a Processor of a Servlet (even
though it says it can wrap anything, the API doesn't say what you have to do
to get it to wrap other objects).  Just yesterday I began writing code using
Servlets to do the minimal business logic (database lookups, etc.) and stuff
data into the request object which I then forward to an XSP page, much like
you do in the MVC design with JSP/Servlets/JavaBeans.  The bonus is that you
get to seperate content/style completely by having the XSP pages do any
remaining data manipulation (e.g., iterating through a result set). This
method of processing works a thousand times better, is significantly faster
and easier to handle then using strictly Cocoon for development.  Even
though I heard it a million times from Stefano and others it took a while
for me to sort out the other noise and realize that Cocoon is a "publishing
framework", not a development tool.  At least not as of yet and maybe it
never will be.  Either way it's amazing for publishing web pages, etc. but
sucks for developing applications.


View raw message