Thank you both for your responses.  While I had tried going down the
ActionInvocation.getInvocationContext(...) road I didn't see anything
interesting that way and probably would have never thought to cast it to a
ServletActionContext (although hopefully I will next time).  I'm using the
ThreadLocal approach right now for brevity.  Is there any performance
difference or other difference between the two approaches that I should be
aware of?  



Yoni Amir-2 wrote:
> 
> Here is an interceptor that I use to manipulate the HttpResponse
> object. You can do the same for the HttpRequest.
> 
> public String intercept(ActionInvocation actionInvocation) throws
> Exception {
>   HttpServletResponse resp = ServletActionContext.getResponse();
>   resp.setHeader("Pragma", "no-cache");
>   // etc ...
> }
> 
> Notice that ActionContext (and ServletActionContext) is ThreadLocal.
> That's why this code is so concise.
> 
> 
> On 6/13/07, Dave Newton <[EMAIL PROTECTED]> wrote:
>> Follow the yellow brick API...
>>
>> What's the signature of Interceptor.intercept?
>>
>> String intercept(ActionInvocation)
>>
>> What's an ActionInvocation? Oh, it's an interface. One
>> thing that looks particularly interesting is
>> ActionInvocation.getInvocationContext(...) -- it's
>> interesting because it contains the word "context".
>>
>> Okay, that returns an ActionContext. One
>> *particularly* interesting implementation of
>> ActionContext is ServletActionContext.
>>
>> d.
>>
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Accessing-HTTP-Header-tf3907721.html#a11100917
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to