Custom response header not working because of Content Length

2009-08-10 Thread Anantha Padmanabha
I'm using tomcat 6.0.18. I added a filter that adds a custom response header by doing setIntHeader/addIntHeader, but it didnt work. I debugged,looked at source and figured out that the place where its not working. Before adding headers, there is a check like this: public boolean isAppCommitted()

Re: Custom response header not working because of Content Length

2009-08-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anantha, On 8/10/2009 11:05 AM, Anantha Padmanabha wrote: I'm using tomcat 6.0.18. I added a filter that adds a custom response header by doing setIntHeader/addIntHeader, but it didnt work. Do you get an error, or is your header just ignored? I

Re: Custom response header not working because of Content Length

2009-08-10 Thread Tim Funk
If you are doing this: doFilter() { chain.doFilter() response.addHeader(...) } Expect failure to occur. (unless you are sending less than 8k in the response) -Tim Anantha Padmanabha wrote: I'm using tomcat 6.0.18. I added a filter that adds a custom response header by doing

Re: Custom response header not working because of Content Length

2009-08-10 Thread Anantha Padmanabha
Hi people, You are correct. My header got ignored and was attempting to add after 'commit'. I moved it to beginning of filter and tried updating towards the end, but after 'commit', I wont be able to able to set the header value :( I'm using struts2 application. I want to add some latencies

Re: Custom response header not working because of Content Length

2009-08-10 Thread Tim Funk
Its probably also failing for less than 8k since I am guess the view is a jsp and when the jsp finishes execution - the response will be committed. (Or somewhere in the request/response cycle - a forward() was done which also will eventually commit the response per the servlet spec) If you

Re: Custom response header not working because of Content Length

2009-08-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anantha, On 8/10/2009 11:45 AM, Anantha Padmanabha wrote: I'm using struts2 application. I want to add some latencies [say mysql, our components and tomcat itself] to header, so that I can print this in Apache logs. Then looking at single apache

Re: Custom response header not working because of Content Length

2009-08-10 Thread Anantha Padmanabha
I wrould read more about struts's request-response cycle. The only reason is I am trying to add to response header is that I can dump my custom response headers in apache logs. That way, all latencies would be tied together making it easy for parsing and analysis. In case of different log files