I'm migrating wicket 1.4 to 6 through 1.5. I encounter an issue that I cannot fix. In wicket 1.4 I used to have (note: Yes, I do 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 I changed it into 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 was desperate and was trying to find anything that does include setHeader() - I do believe I found it in migration guide or something similar. Anyway this does not work. How do I set it? in renderHead? No clue. Thanks in advance.
ResourceStreamResource
doesn't implementHttpServletResponse
. You could useResourceStreamResource#setCacheDuration(Duration.NONE)
to disable caching.It will do the following for you:
Is this what you are after?