server.xml(Tomcat 9)中的SSL连接器配置如下所示
<Connector port="443" protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" SSLEnabled="true">
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig honorCipherOrder="false" >
<Certificate certificateKeyFile="conf/toeflssl.key"
certificateFile="conf/2_toeflmadeeasy.com.crt"
certificateChainFile="conf/1_Intermediate.crt" />
</SSLHostConfig>
使用上面的连接器,多部分表单提交不起作用(在servlet中的服务器上不检索表单变量值)。只需一次更改(删除行<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
)就可以了。但现在我不在HTTP2上。任何人都有任何想法如何让它在HTTP2上工作。
下面给出了样本多部分表单html代码
<form name="multiPartForm" method="post" enctype="multipart/form-data">
<input type="hidden" id="form_submission_type" name="form_submission_type" value="submitTestMultipart">
<input type="hidden" id="var1" name="var1" value="a">
<input type="hidden" id="var2" name="var2" value="b">
File 1:<input type="file" id="file1" name="file1" size="20" value=""><font size="2"></font>
<br>
File 2:<input type="file" id="file2" name="file2" size="20" value=""><font size="2"></font>
<br>
<input type="button" value="Submit" name="submitBtnMP1" onClick="javascript:submitTestMultipartForm();">
<br>
</form>
提前感谢您的任何建议和意见。