cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject Re: better container compliance
Date Tue, 12 Mar 2002 07:23:00 GMT
> Here are some mods done specifically for Websphere, but may be used
> elsewhere. I also have my home-grown version of the IBM WAS StoredResponse
> in case we agree to use some of this.
>
> Itch: JSP generator should really be a servlet generator as JSP's are
> handled by the JSP servlet, which invokes different compilers in various
> implementations.  Cocoon should not be implementation specific  and not
> call the compiler directly, honouring the Container and J2EE spec.  Also,
> we should only take the buffered output of the response and, and ignore
most
> headers (until response headers from external input can participate in
> complex pipeline handling -- future ).
>
> Scratch: In this way, the servlet can be the PHP servlet, SSI, CGI or any
> other existing business servlet, and the web application URI map is
> honoured.  Makes cocoon co-exist and enhance web applications.

JSP Generator uses JSPEngine interface to get the output of a JSP page. The
same JSPEngine is used in JSPReader which simply outputs the response. So,
something like a ServletEngine is needed that will be used to grab output
from other servlets.

Cocoon does not call compiler directly to compile JSP pages. Compiler is
needed to compile the sitemap (if compiled version is used) and for XSP
pages. So, in this case Cocoon honours J2EE spec (don't know any Container
spec).

>
>
> Just the relevant portions --
>
> public class ServletEngineImplRequestDispatcherInclude extends
> AbstractLoggable
>     implements ServletEngine, ThreadSafe {
>
>     public byte[] executeURI(String url, HttpServletRequest httpRequest,
> HttpServletResponse httpResponse, ServletContext context)
>         throws IOException, ServletException, Exception {
>
>         byte[] bytes = null;
>
>         // get ServletEngine Dispatcher.
>         javax.servlet.RequestDispatcher rd = context.getRequestDispatcher(
> url );
>         StoredResponse storedresponse = new StoredResponse();
>         storedresponse.setLocale(httpRequest.getLocale());
>         if (rd != null) {
>           rd.include( httpRequest, storedresponse );
>   bytes = storedresponse.getOutputBuffer();
>         } else {
>           getLogger().error( "Error getting " + url + "from ServletEngine
> Dispatcher" );
>         }
>         return bytes;
>     }
> }
>

Patches are welcome

Konstantin

> ----------------------
> <skipped why="no comments" />
>
> --
> Akber Choudhry
> Dyanet Inc.
> http://www.dyanet.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message