tomcat-5.0.28 in the HTTPS Unable to download file in mode problem resolution
PS :
thisWeb. XMLin theSecurity-constraintnotation:
in thetomcat-5.0.28in thehttpform to access itsWeb "cannot" automatically jump when appliedHTTPS
in thetomcat-5.5.20in thehttpform to access itsWebapply when "can automatically jump toHTTPS"
Environment
tomcat-5.0.28 (ConfigurationHTTPS),jdk1.6
WebApplicationWeb. XMLSecurity-related configuration:
<security-constraint>
<web-resource-collection>
<web-resource-name>OPENSSL</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Questions:
Webapplications, inHTTPSmode, the file specified in the link in the page cannot be downloaded under IE8, but there is no problem in IE11
JSPthe file link in the page is shaped like:
<a href= "${CP}/xxxx/setup.exe" >Downloadxx</a>
Problem Solving:
write a file to downloadFilter, and conductResponse.setheaderafter setting, IE8 can download files in the Web App in HTTPS mode
FilterCode:
public class Filesslfilter implements Filter {
private static final Logger Logger =logger.getlogger ("Logger");
public void init (Filterconfig filterconfig) throws Servletexception {
Logger.info (">>>>>>>> filesslfilterinit ...");
}
Public void DoFilter (servletrequest request,servletresponse response,
Filterchain chain) throws IOException, Servletexception {
HttpServletRequest httpservletrequest = (httpservletrequest) request;
HttpServletResponse HttpServletResponse = (httpservletresponse) response;
// throughHTTPSAccess. XXXformat File
if (httpservletrequest.getscheme () = = "https"
&&httpservletrequest.getrequesturi (). EndsWith (". exe"))
{
Httpservletresponse.setheader ("Expires", "0");
Httpservletresponse.setheader ("Pragma", "public");
Httpservletresponse.setheader ("Cache-control", "must-revalidate,post-check=0, pre-check=0");
Httpservletresponse.setheader ("Cache-control", "public");
}
Chain.dofilter (request, response);
}
public void Destroy () {
Logger.info (">>>>>>>> Filesslfilterdestroy .....");
}
}
Web. XML added in:
<filter>
<filter-name>FileSSLFilter</filter-name>
<filter-class>com.hispeed.model.filter.FileSSLFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>FileSSLFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
tomcat-5.0.28 Unable to download file in HTTPS mode problem resolution