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

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -