Re: Multipart form submission does not work over SSL HTTP2 on Tomcat 9
I am getting a null returned from HttpServletRequest.getParts() HTTP/2 and multipart (see http://bit.ly/1TzXd9k). This happens in my own code, as well as when I try to upload a *.WAR though the manager/html web page. Other than configuring the connector and the upgrade protocol (see below), what must be done? On Tue, Mar 22, 2016 at 5:32 PM, Violeta Georgievawrote: > Hi, > > 2016-03-19 23:21 GMT+02:00 Ajay Verma : > > > > Hello, > > I'm trying to get multipart forms working in Tomcat 9 over HTTP2 (with > TLS enabled). > > > > The SSL Connector configuration in server.xml (Tomcat 9) is given > below protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" > SSLEnabled="true"> > > > > > > > certificateFile="conf/2_toeflmadeeasy.com.crt" /> > > Multipart form submission does not work (the form > variable values are not retrieved on server in the servlet) with above > connector.The sample multipart form html code is given below name="multiPartForm" method="post" enctype="multipart/form-data"> > > name="form_submission_type" value="test"> > > File 1: > > File 2: > > > > > > I am trying to get form parameters by using the > getParameter("form_submission_type") method on HttpServletRequest, and it > returns null under HTTP2. If I remove the line className="org.apache.coyote.http2.Http2Protocol" />) it works. But now I > am not on HTTP2. > > > > Anyone have any ideas how I can get it to work on HTTP2? > > Is it possible for you to test your configuration with the manager > application that comes with Tomcat distribution? > It uses multipart. > > I tested it on my side and the manager application is working with HTTP/2 > and multipart. > > Regards, > Violeta > > > Thanks in advance for any suggestions and comments. > > Ajay > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, *Doctor Faustus* (v. 121-24)
Re: Multipart form submission does not work over SSL HTTP2 on Tomcat 9
Hi, 2016-03-19 23:21 GMT+02:00 Ajay Verma: > > Hello, > I'm trying to get multipart forms working in Tomcat 9 over HTTP2 (with TLS enabled). > > The SSL Connector configuration in server.xml (Tomcat 9) is given below > > > certificateFile="conf/2_toeflmadeeasy.com.crt" /> > Multipart form submission does not work (the form variable values are not retrieved on server in the servlet) with above connector.The sample multipart form html code is given below > > File 1: > File 2: > > > I am trying to get form parameters by using the getParameter("form_submission_type") method on HttpServletRequest, and it returns null under HTTP2. If I remove the line ) it works. But now I am not on HTTP2. > > Anyone have any ideas how I can get it to work on HTTP2? Is it possible for you to test your configuration with the manager application that comes with Tomcat distribution? It uses multipart. I tested it on my side and the manager application is working with HTTP/2 and multipart. Regards, Violeta > Thanks in advance for any suggestions and comments. > Ajay
Re: Multipart form submission does not work over SSL HTTP2 on Tomcat 9
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mark, On 3/19/16 9:18 PM, Mark Olsson wrote: > On Sat, Mar 19, 2016 at 2:21 PM, Ajay Verma >wrote: > >> Hello, I'm trying to get multipart forms working in Tomcat 9 over >> HTTP2 (with TLS enabled). >> >> The SSL Connector configuration in server.xml (Tomcat 9) is >> given below> protocol="org.apache.coyote.http11.Http11AprProtocol" >> maxThreads="150" SSLEnabled="true"> > className="org.apache.coyote.http2.Http2Protocol" /> >> > certificateKeyFile="conf/toeflssl.key" >> certificateFile="conf/2_toeflmadeeasy.com.crt" /> >> Multipart form submission does not work (the >> form variable values are not retrieved on server in the servlet) >> with above connector.The sample multipart form html code is given >> below> enctype="multipart/form-data"> > id="form_submission_type" name="form_submission_type" >> value="test"> File 1:> size="20" value=""> File 2:> name="file2" size="20" value=""> > value="Submit" name="submit"> I am trying to get form >> parameters by using the getParameter("form_submission_type") >> method on HttpServletRequest, and it returns null under HTTP2. If >> I remove the line > className="org.apache.coyote.http2.Http2Protocol" />) it works. >> But now I am not on HTTP2. >> >> Anyone have any ideas how I can get it to work on HTTP2? Thanks >> in advance for any suggestions and comments. Ajay >> > > I can't speak for Tomcat 9, but for T8 getParameter() won't work on > a multi-part form. I vaguely recall there's a Tomcat way of > getting the parameters, but I ended up using Apache's FileUpload > library which will generate a list of files and parameters for the > request. Though I have no idea if FileUpload will work with HTTP2 > or not. If you are using servlet 3.0+, there's no reason to use a separate file-upload library. Use HttpServletRequest.getParts() and related API calls. I'm not sure if this has anything to do with http2. - -chris -BEGIN PGP SIGNATURE- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlbxowMACgkQ9CaO5/Lv0PD5HwCgvtMzf8YX2pZ/9ZzxGPsVceDg kQUAmgMoMbqhThf1u6O7Ja0rDWrygtEi =jIxq -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Multipart form submission does not work over SSL HTTP2 on Tomcat 9
On Sat, Mar 19, 2016 at 2:21 PM, Ajay Vermawrote: > Hello, > I'm trying to get multipart forms working in Tomcat 9 over HTTP2 (with TLS > enabled). > > The SSL Connector configuration in server.xml (Tomcat 9) is given > below protocol="org.apache.coyote.http11.Http11AprProtocol" maxThreads="150" > SSLEnabled="true"> > > > certificateFile="conf/2_toeflmadeeasy.com.crt" /> > Multipart form submission does not work (the form > variable values are not retrieved on server in the servlet) with above > connector.The sample multipart form html code is given below name="multiPartForm" method="post" enctype="multipart/form-data"> > value="test"> > File 1: > File 2: > > > I am trying to get form parameters by using the > getParameter("form_submission_type") method on HttpServletRequest, and it > returns null under HTTP2. If I remove the line className="org.apache.coyote.http2.Http2Protocol" />) it works. But now I > am not on HTTP2. > > Anyone have any ideas how I can get it to work on HTTP2? > Thanks in advance for any suggestions and comments. > Ajay > I can't speak for Tomcat 9, but for T8 getParameter() won't work on a multi-part form. I vaguely recall there's a Tomcat way of getting the parameters, but I ended up using Apache's FileUpload library which will generate a list of files and parameters for the request. Though I have no idea if FileUpload will work with HTTP2 or not.
Multipart form submission does not work over SSL HTTP2 on Tomcat 9
Hello, I'm trying to get multipart forms working in Tomcat 9 over HTTP2 (with TLS enabled). The SSL Connector configuration in server.xml (Tomcat 9) is given below Multipart form submission does not work (the form variable values are not retrieved on server in the servlet) with above connector.The sample multipart form html code is given below File 1: File 2: I am trying to get form parameters by using the getParameter("form_submission_type") method on HttpServletRequest, and it returns null under HTTP2. If I remove the line ) it works. But now I am not on HTTP2. Anyone have any ideas how I can get it to work on HTTP2? Thanks in advance for any suggestions and comments. Ajay