java - How to setHeader in ResourceStreamRequestHandler#configure(..) (migration issue) -
i'm migrating wicket 1.4 6 through 1.5. encounter issue cannot fix. in wicket 1.4 used have (note: yes, have detach
)
public class tempfileresourcerequesttarget extends resourcestreamrequesttarget implements serializable { @override protected void configure(final requestcycle requestcycle, final response response, final iresourcestream resourcestream) { super.configure(requestcycle, response, resourcestream); ((webresponse)response).gethttpservletresponse().setheader("cache-control",""); ((webresponse)response).gethttpservletresponse().setheader("pragma",""); }
in wicket 1.5/6 changed this:
public class tempfileresourcerequesttarget extends resourcestreamrequesthandler implements serializable { @override protected void configure(resourcestreamresource resource) { super.configure(resource); ((httpservletresponse)resource).setheader("cache-control",""); ((httpservletresponse)resource).setheader("pragma",""); } }
i desperate , trying find include setheader() - believe found in migration guide or similar. anyway not work. how set it? in renderhead? no clue. in advance.
resourcestreamresource
doesn't implement httpservletresponse
. use resourcestreamresource#setcacheduration(duration.none)
disable caching.
it following you:
public void disablecaching() { this.setdateheader("date", time.now()); this.setdateheader("expires", time.start_of_unix_time); this.setheader("pragma", "no-cache"); this.setheader("cache-control", "no-cache, no-store"); }
is after?
Comments
Post a Comment