Return-Path: Delivered-To: apmail-xml-cocoon-users-archive@xml.apache.org Received: (qmail 59238 invoked by uid 500); 15 Aug 2001 10:28:28 -0000 Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-users@xml.apache.org Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 59220 invoked from network); 15 Aug 2001 10:28:28 -0000 Expiry-Date: Tue, 13 Nov 2001 -1:-1:-1 +0000 Subject: Re: C2 request object To: cocoon-users@xml.apache.org Bcc: From: aaldridg@csc.com Date: Wed, 15 Aug 2001 11:28:03 +0100 Message-ID: X-MIMETrack: Serialize by Router on VA-FCH31/SRV/CSC(Release 5.0.4a |July 24, 2000) at 08/15/2001 06:31:21 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi, I had the same problem. It's strange the API says that HttpRequest implements HttpServletRequest. It does in all but name - ie it has all the methods, but doesn't explicitly implement the interface. I posted this question before asking if this was an oversight or done on purpose - but no response. Perhaps this is one for the dev group to answer. Looking at the code, it would be simple either to add an access method (getRequest) to the HttpRequest object, or to simply formally implement the interface. In the meantime I've simply recoded my software to use HttpRequest instead of HttpServletRequest (which is inconvenient, but hey...). The Cocoon request object CAN be cast to a (Cocoon) HttpRequest object. This does have the same methods, so the code just needs adjusting to use the Cocoon class instead of the javax class. I wonder why ... Here's some xsp code I use now: jbxsp = new Jbxsp ( (org.apache.cocoon.environment.http.HttpRequest )(request) , "com.jpmorgan.mih.intranet.example.SimpleSite"); Unfortunately, because I'm mindful that the javax class would be more useful in general, and I would hope it will become available, I have to duplicate my java methods, one for each class - not nice! eg public void setReq(javax.servlet.http.HttpServletRequest req){ setRequest(req); .... } public void setReq(org.apache.cocoon.environment.http.HttpRequest req){ setRequest(req); ... } I use the setRequest with the Cocoon class to set a flag (boolean c2), so that other methods relying on the request object can use the correct version. All a bit of a hack really... eg String eCom = null; String sTag = null; if(c2) eCom = hreq.getParameter("mih_edit_component"); else eCom = req.getParameter("mih_edit_component"); if(c2) sTag = hreq.getParameter("mih-selected-tag"); else sTag = req.getParameter("mih-selected-tag"); Never mind! Regards, Anthony Aldridge Lead Application developer Managed Intranet Hosting Personal GDP: 325-8338 MIH Hotline: 876-1300 Cassandra Bonner on 15/08/2001 06:17:45 Please respond to cocoon-users@xml.apache.org To: cocoon-users@xml.apache.org cc: Subject: Re: C2 request object Hmmm, we hit this as well while migrating, but i assumed from the posting below that there is no way to get to the javax.servlet.HttpServletReq/Resp.?. I've moved to the cocoon req,resp (which according to this posting is more generic), but I don't understand how this will be portable. As you, I have java code called outside my xsp pages (not beans, but manager classes) that uses the req and resp, which now has to be coded with cocoon req resp. Anyways, the posting might offer some consolation.?. If you find a way to use javax.servlet.*, pls post to group. http://mailman.real-time.com/pipermail/cocoon-users/2001-April/013154.html thanks! cass --- Paul Lamb wrote: > I'm porting some c1 code over and need to get the actual > javax.servlet.http.HttpServletRequest object in a xsp page so that > it > can be passed to another bean. > > Casting the request object doesn't work and I can't find a > getRequest() > method. > > Any suggesting are appreciated. > > Paul Lamb > > --------------------------------------------------------------------- > Please check that your question has not already been answered in > the > FAQ before posting. > > To unsubscribe, e-mail: > For additional commands, e-mail: > __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: For additional commands, e-mail: --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: For additional commands, e-mail: