>From what I can understand (do correct me if I'm wrong) of the framework, the data starts to get sent to the client at the Result (in my case, VelocityResult). The interceptors wrap around the actions, which get executed before the result. Either way, the header is set before the response is committed, no ?
----- Original Message ----- From: "Cameron Braid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 03, 2003 8:34 PM Subject: RE: [OS-webwork] No Cache result... > Headers need to be set before the response is committed. (ie started to > be sent to the client) since they get added to the start of the http > response, before the body. > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On > > Behalf Of Bernard Choi > > Sent: Friday, 3 October 2003 9:25 PM > > To: [EMAIL PROTECTED] > > Subject: [OS-webwork] No Cache result... > > > > > > Greetings all, > > > > managed to get it work, but not sure why. > > > > The fix was as follows : > > > > public String intercept(ActionInvocation invocation) > > throws Exception { > > HttpServletResponse response = > > ServletActionContext.getResponse(); > > response.addHeader("expires", "-1"); > > response.addHeader("pragma", "no-cache"); > > response.addHeader("cache-control", "no-store, > > no-cache, must-revalidate"); > > > > String result = invocation.invoke(); > > > > return result; > > } > > > > By setting the response BEFORE the invokation. No idea why though. > > > > > > >Greetings all, > > > > > >Just to check, is there something special about the way WW2 > > handles the > > >httpResponses ? > > > > > >I have a need to disable the cacheing for a number of pages, > > and thus, > > >an interceptor was written to set the relevant headers in the > > >httpResponse. > > > > > > public String intercept(ActionInvocation invocation) > > throws Exception { > > > String result = invocation.invoke(); > > > > > > HttpServletResponse response = > > ServletActionContext.getResponse(); > > > response.addHeader("expires", "-1"); > > > response.addHeader("pragma", "no-cache"); > > > response.addHeader("cache-control", "no-store, > > no-cache, > > >must-revalidate"); > > > > > > return result; > > > } > > > > > >I see that the response is indeed being set, but by the time > > it reaches > > the > > >browser, the results are still being cached. > > > > > >Just to check , is this the proper way to handle the response ? > > > > > > > > > > > >------------------------------------------------------- > > >This sf.net email is sponsored by:ThinkGeek > > >Welcome to geek heaven. > > >http://thinkgeek.com/sf > > _______________________________________________ > > >Opensymphony-webwork mailing list > > >[EMAIL PROTECTED] > > >https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Opensymphony-webwork mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork