Howdy,
Howdy,

>The getHeader methods does not return any reference to any kind of
header
>object which I could modify.
>I would have to create my own setHeader method instead.  There has to
be an
>easier way to do this.

What Tim suggests IS an easy way to do the kludge you're trying to do.
Assuming you know the names of your two special headers, let's say
HEADER_X and HEADER_Y, simply overwrite getHeader in your wrapper such
that:

public String getHeader(String name) {
        if(name.equals(HEADER_X)) {
          return FAKE_HEADER_X_VALUE;
      } else if(name.equals(HEADER_Y)) {
        return FAKE_HEADER_Y_VALUE;
      } else {
        // return wrappedRequest.getHeader(name);
        // return super.getHeader(name);
      }
}

I had the commented out forms because either may apply depending on how
you code your wrapper: you pick.

You can also modify getHeaderNames() to include your fake headers if you
wish: that depends on how your authentication filter is written.

Yoav Shapira

>
>Any other ideas?
>
>-Joshua
>
>
>-----Original Message-----
>From: Tim Funk [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, July 16, 2003 7:34 AM
>To: Tomcat Users List
>Subject: Re: Is it possible to add header values to the request (not
the
>respo nse)?
>
>
>You can do this via a Filter and HttpServletRequestWrapper, where your
>imlpementation of HttpServletRequestWrapper will extend the needed
>getHeader
>
>methods to send the additional stuff you need.
>
>-Tim
>
>White, Joshua A (HTSC, CASD) wrote:
>> Hey all,
>>
>> My production application uses a site minder web agent.  This agent
>places
>> two name/value pairs into the request header, one for userName, the
other
>> for domain.
>>
>> In my application, I have a filter which looks for these values to
make
>sure
>> the user is logged in.  Currently I do not have site minder in my
>> development environment, but I would like to simulate its
functionality
>by
>> placing values in the request header before my other filter looks for
>them.
>>
>> I know that you can place values in the response header.  Can it be
done
>> with the request as well?
>>
>
>
>
>
>This communication, including attachments, is for the exclusive use of
>addressee and may contain proprietary, confidential or privileged
>information. If you are not the intended recipient, any use, copying,
>disclosure, dissemination or distribution is strictly prohibited. If
>you are not the intended recipient, please notify the sender
>immediately by return email and delete this communication and destroy
all
>copies.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to