W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 1998

Re: replace request

From: Paul Pazandak <pazandak@OBJS.com>
Date: Tue, 17 Feb 1998 16:41:53 -0600
Message-ID: <34EA124C.9D49E5B6@OBJS.com>
To: "Lv, Qiang" <qianglu@cis.njit.edu>
CC: www-jigsaw@w3.org

I agree that your approach will not work.  What I had suggested
is that you modify the request object. Your code simply reassigns
a local attribute to reference a different object.

What you need to do is use the interface of the Request object
to modify the object itself, e.g.

if (conditions) {
    request.setURLPath(...)
}

Paul.

Lv, Qiang wrote:

> On Tue, 17 Feb 1998, Paul Pazandak wrote:
>
> >
> > You should be able to simply modify the Request object and return it.
> It seems I can not RETURN that Request object to Jigsaw core. I write my
> filter's ingoingFilter method like this:
>
>         Request AnotherRequest;
> public Reply ingoingFilter(Request request) {
>         if (conditons) {
>                 request = AnotherRequest;
>         }
>         return null;
> }
>
> But the fact is Jigsaw did not use the old request, instead of the new
> AnotherRequest as its forward request. I think it is normal because that
> request was passed to ingoingFilter just as an instance, what I did
> within the ingoingFilter will not effect the outside request. Therefore
> my following question araised.
>
> Thanks,
> Qiang
>
> >
> > Paul.
> >
> >
> >
> > Lv, Qiang wrote:
> >
> > > Hi,
> > >
> > > I sucessfully set up Jigsaw as a proxy server. Now I can intercept
> > > request from clients in my filter. I want to check these requests, then
> > > replace some requests with mine in some conditions. The problem is:
> > > ingoingFilter only get a instance of Request. How can I replace that
> > > request with a new one and let Jigsaw forward my new request?
> > >
> > > Thanks,
> > >
> > > -------------------------------------------------
> > > Qiang Lv
> > > room 4220, ITC building
> > > CIS department, NJIT
> > > University Heights
> > > Newark, NJ 07102
> > > Tel: 973-596-2863(O)     973-596-2594(H)
> > > Fax: 973-596-5777
> > > ------------------------------------------------
> >
> >
> >
> >

   --

********************************************************************
Paul Pazandak                                      pazandak@objs.com
Object Services and Consulting, Inc.             http://www.objs.com
Minneapolis, Minnesota 55420-5409                       612-881-6498
********************************************************************
Received on Tuesday, 17 February 1998 17:38:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:27 GMT