Hi Vincent,

It certainly would. I was looking in the wrong class for the wrong method
name. Thanks for the steer.

Paul Green
Developer, JTU, Office for National Statistics
Tel (01633) 812524
Mobile (07720) 324594

Paul's pointless fact of the week:
"Twenty-one percent of American smokers do not believe that nicotine is
addictive."


|---------+---------------------------->
|         |           [EMAIL PROTECTED]|
|         |           om               |
|         |                            |
|         |           27/02/04 09:38   |
|         |           Please respond to|
|         |           cactus-user      |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                          |
  |       To:       [EMAIL PROTECTED]                                                  
             |
  |       cc:                                                                          
                          |
  |       Subject:  Returning custom HTTP headers (was RE: 
AbstractHttpServletRequestWrapper -                   |
  |        NullPointerException)                                                       
                          |
  
>--------------------------------------------------------------------------------------------------------------|




Hi Paul,

> -----Original Message-----
> From: Paul Green [mailto:[EMAIL PROTECTED]
> Sent: 27 February 2004 10:33
> To: [EMAIL PROTECTED]
> Subject: RE: AbstractHttpServletRequestWrapper - NullPointerException
>
>
> Hi Vincent/Everyone,
>
> Thanks for the bug fix. I have need of a capability of Cactus that
doesn't
> currently seem to exist. I need my HttpRequest's getHeader(String)
method
> to return a value that I set directly, in my test case. There is no
> setHeader(String, String) method in AbstractHttpServletRequestWrapper
and
> I
> can't see any other way of doing this. Having looked at the code, it
seems
> to me that customised headers could be held in an object of this
class,
> and
> then returned, if previously set, by the getHeader method, instead of
> their
> respective original request headers. Is there an existing way of doing
> this, and if not, is my suggestion feasible?

>From WebRequest javadoc:

    /**
     * Adds a header to the request. Supports adding several values for
the
     * same header name.
     *
     * @param theName  the header's name
     * @param theValue the header's value
     */
    void addHeader(String theName, String theValue);

Would that do the trick or am I missing something?

Thanks
-Vincent

>
> Regards,
>
> Paul Green
> Developer, JTU, Office for National Statistics
> Tel (01633) 812524
> Mobile (07720) 324594
>
> Paul's pointless fact of the week:
> "Twenty-one percent of American smokers do not believe that nicotine
is
> addictive."
>
>
> |---------+---------------------------->
> |         |           [EMAIL PROTECTED]|
> |         |           om               |
> |         |                            |
> |         |           25/02/04 10:40   |
> |         |           Please respond to|
> |         |           cactus-user      |
> |         |                            |
> |---------+---------------------------->
>
>-----------------------------------------------------------------------
> ---------------------------------------|
>   |
> |
>   |       To:       [EMAIL PROTECTED]
> |
>   |       cc:
> |
>   |       Subject:  RE: AbstractHttpServletRequestWrapper -
> NullPointerException                                 |
>
>-----------------------------------------------------------------------
> ---------------------------------------|
>
>
>
>
> Hi Paul,
>
> You found a bug! I have just fixed it (I hope) in CVS HEAD. I'll
upload
> a nightly build tonight.
>
> Thanks
> -Vincent
>
> > -----Original Message-----
> > From: Paul Green [mailto:[EMAIL PROTECTED]
> > Sent: 25 February 2004 11:07
> > To: [EMAIL PROTECTED]
> > Subject: AbstractHttpServletRequestWrapper - NullPointerException
> >
> > Hi All,
> >
> > I have a piece of code that calls request.getPathTranslated() which,
> in
> > Cactus, ends up as a call to
> > AbstractHttpServletRequestWrapper.getPathTranslated(). This appears
to
> be
> > throwing a NullPointerException on line 314, where it tries to call
> > getPathInfo() on the instance variable "url". This instance variable
> is
> > set
> > when the constructor is called, and the Javadoc says that it can be
> set to
> > null. In order to make my code work, therefore, I need to find out
how
> to
> > have a non-null "url" parameter passed to the constructor of
> > AbstractHttpServletRequestWrapper. Does anyone know how I can do
this?
> >
> > Regards,
> >
> > Paul Green
> > Developer, JTU, Office for National Statistics
> >
> > Paul's pointless fact of the week:
> > "Twenty-one percent of American smokers do not believe that nicotine
> is
> > addictive."
> >
> >
> >
> >
> > For the latest data on the economy and society
> > consult National Statistics at http://www.statistics.gov.uk
> >
> >
**********************************************************************
> > Please Note:  Incoming and outgoing email messages
> > are routinely monitored for compliance with our policy
> > on the use of electronic communications
> >
**********************************************************************
> > Legal Disclaimer  :  Any views expressed by
> > the sender of this message are not necessarily
> > those of the Office for National Statistics
> >
**********************************************************************
> >
> > The original of this email was scanned for viruses by the Government
> > Secure Intranet (GSi) virus scanning service supplied exclusively by
> > Energis in partnership with MessageLabs.
> >
> > On leaving the GSi this email was certified virus-free
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> PLEASE NOTE: THE ABOVE MESSAGE WAS RECEIVED FROM THE INTERNET.
>
> On entering the GSI, this email was scanned for viruses by the
Government
> Secure Intranet (GSI) virus scanning service supplied exclusively by
> Energis Communications in partnership with MessageLabs.
>
> GSI users see
> http://www.gsi.gov.uk/main/notices/information/gsi-003-2002.pdf for
> further
> details. In case of problems, please call your organisational IT
helpdesk.
>
>
>
>
>
>
> The original of this email was scanned for viruses by the Government
> Secure Intranet (GSi) virus scanning service supplied exclusively by
> Energis in partnership with MessageLabs.
>
> On leaving the GSi this email was certified virus-free
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



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


PLEASE NOTE: THE ABOVE MESSAGE WAS RECEIVED FROM THE INTERNET.

On entering the GSI, this email was scanned for viruses by the Government
Secure Intranet (GSI) virus scanning service supplied exclusively by
Energis Communications in partnership with MessageLabs.

GSI users see
http://www.gsi.gov.uk/main/notices/information/gsi-003-2002.pdf for further
details. In case of problems, please call your organisational IT helpdesk.






The original of this email was scanned for viruses by the Government Secure Intranet 
(GSi) virus scanning service supplied exclusively by Energis in partnership with 
MessageLabs.

On leaving the GSi this email was certified virus-free

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

Reply via email to