tomcat-5.0.28 Unable to download file in HTTPS mode problem resolution

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.