Stream Result issue with Internet Explorer over HTTPS

You can face some issues with HTTPS with certain versions of Internet Explorer. When trying to stream PDF's, TIFF's, and other types of content over HTTPS to certain versions of Internet Explorer it may trigger a broken interpretation of the HTTP specification. You can apply the following interceptor to your actions to set the HTTP headers cache settings to private. This should avoid the issue. Please note you should apply this if you are running over HTTPS!.

public class HTTPInternetExpHttpsRequestCachePrivateInterceptor extends AroundInterceptor {

    protected void after(ActionInvocation actionInvocation, String string) throws Exception {
        //
    }

    protected void before(ActionInvocation actionInvocation) throws Exception {
        HttpServletResponse response = (HttpServletResponse) actionInvocation.getInvocationContext().get(ServletActionContext.HTTP_RESPONSE);
        response.setHeader("CACHE-CONTROL", "PRIVATE");
    }
}

More stories on struts2

struts2 - Displaying Checkboxlist Vertically
File Download Issue in Internet Explorer - Struts2
struts2 Interview questions - I

No comments:

Post a Comment