cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: [C2] RequestDispatchers && XSP
Date Tue, 17 Oct 2000 15:51:31 GMT
Marcus Crafter wrote:
> 
> Hi All,
> 
>         I've noticed some interesting behaviour in C2 with the use of
>         RequestDispatcher objects in T4M2. The following code is taken from
>         T4M2 (ApplicationRequest.java && ApplicationHttpRequest.java):
> 
> line 215 && 387 resp.:
> 
>         while (request != null) {
>             if (request instanceof Request)
>                 break;
> *           if (!(request instanceof ServletRequestWrapper)) {
>                 throw new IllegalArgumentException
>                     (sm.getString("applicationRequest.badRequest"));
>             }
>             request = ((ServletRequestWrapper) request).getRequest();
>         }
> 
>         The code was found during a trace of what happens when one does a
> 
>           request.getRequestDispatcher("xyz").forward(request, response);
> 
>         in some XSP code.
> 
>         The T4M2 code unfortunately throws an IllegalArgumentException (at the
>         *) as it expects a ServletRequestWrapper instance - and we pass it a
>         Cocoon 2 internal HttpRequest object which doesn't inherit from
>         ServletRequestWrapper (implements HttpServletRequest).
> 
>         Question is, what can we do about it ? ServletRequestWrapper is a
>         Servlet 2.3 thing so we would wipe out all the T3 users if we changed
>         HttpResponse to extend from it (then again.. C2 seems to be really a
>         T4 app anyway.. :-) ).
> 
>         To fix the problem I changed HttpEnvironment.java to store the
>         original servlet parameters as well as the C2 custom ones, and changed
>         ServletGenerator.java to use these values for the XSP request/response
>         variables. Patch is attached.
> 
>         This was a bit of a hack though. Any other ideas about to tackle this
>         one ?

Uh, big issue here.

So the real question is: should we support T3 at all?

What do you think?

>         BTW - should mails like this really go to cocoon-dev or is
>         cocoon-users more appropriate ?

No, this is perfect.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Mime
View raw message