Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 5305 invoked from network); 22 Feb 2000 18:07:46 -0000 Received: from adsl-63-198-47-229.dsl.snfc21.pacbell.net (HELO costin.dnt.ro) (63.198.47.229) by locus.apache.org with SMTP; 22 Feb 2000 18:07:46 -0000 Received: from localhost (costin [63.198.47.229]) by costin.dnt.ro (8.9.3+Sun/8.9.1) with ESMTP id KAA14166 for ; Tue, 22 Feb 2000 10:07:32 -0800 (PST) From: costin@eng.sun.com Date: Tue, 22 Feb 2000 02:08:49 -0800 (PST) To: Tomcat-Dev Subject: Re: Problem with RequestDispatcher In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII > Turns out the RequestDispatcher.include() method uses the following line: > > Request realRequest = ((HttpServletRequestFacade)request).getRealRequest(); It seems the spec requires to pass the _original_ request/response object. I would love to remove this limitation, I also think it's very usefull to pass arbitrary request objects to RD - but I don't think we can do too much about this in Servlet 2.2. I know few other engines that assume the parameter of RD is the original request, so your servlet will not be portable even if we change tomcat. The reason for this restriction _may_ be the fact that the engine must change the Request object, and that's not possible unless with the read only HttpServletRequest. One solution would be to create a facade, but that's very expensive - too many object allocation/request. Costin > Of course, I was passing *my* PortalRequestFacade object and I get a class > cast exception. Is it necessary to assume this type of cast? Wouldn't it be > better to have two include() methods, such as: > > public void include(ServletRequest request, ServletResponse response); > public void include(HttpServletRequestFacade request, > HttpServletRequestFacade response) { > Request realRequest = request.getRealRequest(); > Response realResponse = response.getRealResponse(); > include (realRequest, realResponse); > } > > I would extend your facade class to facilitate my needs, however I would > like this to be a portable solution. > > thanks, > jim > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org >