Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 33210 invoked from network); 28 Jun 2005 18:27:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jun 2005 18:27:12 -0000 Received: (qmail 54351 invoked by uid 500); 28 Jun 2005 18:27:04 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 54302 invoked by uid 500); 28 Jun 2005 18:27:03 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 54289 invoked by uid 99); 28 Jun 2005 18:27:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2005 11:27:03 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=FROM_ENDS_IN_NUMS,MSGID_FROM_MTA_HEADER X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of ats37@hotmail.com designates 65.54.175.24 as permitted sender) Received: from [65.54.175.24] (HELO hotmail.com) (65.54.175.24) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Jun 2005 11:27:02 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 28 Jun 2005 11:27:00 -0700 Message-ID: Received: from 65.54.175.207 by by104fd.bay104.hotmail.msn.com with HTTP; Tue, 28 Jun 2005 18:27:00 GMT X-Originating-IP: [65.54.175.207] X-Originating-Email: [ats37@hotmail.com] X-Sender: ats37@hotmail.com From: "Andrew Stevens" To: users@cocoon.apache.org Subject: JSPEngineServletRequest and Websphere Date: Tue, 28 Jun 2005 19:27:00 +0100 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 28 Jun 2005 18:27:00.0550 (UTC) FILETIME=[F9659E60:01C57C0E] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I've been having some problems with the JSP generator on Websphere, which I've tracked down to the JSPEngineServletRequest. Does anyone know why it was implemented in the way it is? I had no trouble at first, reading the output of relatively simple JSPs. I had to adapt a few of them with an all-enclosing div element (to avoid complaints that "the content after the root element must be well formed"), but that's no big deal. However, the problems started once I tried to use the output of some JSPs which contained tags - these just threw ServletExceptions complaining that "Request wrapper is not of type HttpServletRequestWrapper". Exactly where it's got the wrapper from I'm not sure, presumably somewhere buried deep in the request dispatcher's include method. but it appears that whenever the request object type is Cocoon's JSPEngineServletRequest rather than Websphere's SRTServletRequest it can't handle this and the result is this exception. In fact, this problem isn't specific to Cocoon; any RequestDispatcher.include call passing in a custom request object to a JSP that contains a jsp:include (or JSTL to a local path, since that also goes through the request dispatcher again) gives the same problem. However, since that's the way Cocoon's JSP generator/reader work, they suffer the same restriction. Since removing all the includes from our JSPs isn't an option, it looks like I might have to write a Websphere-specific JSPEngine implementation to work around this. At least it means the WLS one will have some company :-) However, as I started working on this it got me wondering why the JSPEngineServletRequest is written the way it is. As far as I can see, for the most part it's doing exactly the same as the standard HttpServletRequestWrapper class does - it wraps the original request and passes most of the method calls through to it. Why didn't it just extend HttpServletRequestWrapper? Add a two-arg constructor which stores the jspFile and calls super(request), override getAttribute and a few other methods, and not only would it be half the size but things ought to start working in Websphere without any additional changes being needed... Or is there some particular reason it does all that delegating itself? Also, I'm curious about the choice of methods which don't just delegate to the wrapped request. Why is getParameterMap overridden to return null when getParameter, getParameterNames and getParameterValues still return the original values? Likewise, why override getRequestURL to return null (the cause, I believe, of the "org.apache.jasper.JasperException: No output directory: String index out of range: -1" error I started getting from Websphere) when getRequestURI, getServletPath, etc. still return their original values? It all seems rather inconsistent to me. Anyone know (or care to guess at) the reasons for doing this? Or is it simply that it's always been that way? Would I be better off asking on the dev mailing list? Andrew. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org