Repository: quarkusio/quarkus
Issue: Quarkus/Undertow does not parse request parameters correctly from multipart post

**Describe the bug**
We tried to setup a PrimeFaces FileUpload with the new MyFaces Quarkus Extension but the post is not correctly considered as postback in JSF as the underlying HttpServletRequest doesnt have any post params.
I tested it and it works fine on jetty.

**Expected behavior**
HttpSevletRequest also parses post params from the multipart request

**Actual behavior**
empty request params


**To Reproduce**
Steps to reproduce the behavior:
1. Build MyFaces (git clone https://github.com/apache/myfaces/  and  mvn clean install -DskipTests)
2. Run the Showcase (https://github.com/apache/myfaces/tree/master/extensions/quarkus/showcase): mvn compile quarkus:dev -Ddebug
3. Open localhost:8080/file.xhtml
4. Select a file in the second / simple exmaple and use the styled or not styled button to submit it
5. if you check the post in the browser tools, it's a multipart and correclty contains the javax.faces.ViewState param
6. Now debug HtmlResponseStateManager#isPostback and you will see that the underlying HttpServletRequest doesnt have ANY request params

**Configuration**
```properties
# Add your application.properties here, if applicable.

```

**Screenshots**
(If applicable, add screenshots to help explain your problem.)

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: 
 - Output of `java -version`: 
 - GraalVM version (if different from Java): 
 - Quarkus version or git rev: 
 - Build tool (ie. output of `mvnw --version` or `gradlew --version`): 

**Additional context**
(Add any other context about the problem here.)


Changed files:
extensions/undertow/spi/src/main/java/io/quarkus/undertow/deployment/ServletBuildItem.java
extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java
extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/MultipartConfigTestCase.java

diff --git a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java
index b0c409a9839..8fbb654190c 100644
--- a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java
+++ b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java
@@ -491,6 +491,11 @@ public ServletDeploymentManagerBuildItem build(List<ServletBuildItem> servlets,
             for (Map.Entry<String, String> entry : servlet.getInitParams().entrySet()) {
                 recorder.addServletInitParam(s, entry.getKey(), entry.getValue());
             }
+            if (servlet.getMultipartConfig() != null) {
+                recorder.setMultipartConfig(s, servlet.getMultipartConfig().getLocation(),
+                        servlet.getMultipartConfig().getMaxFileSize(), servlet.getMultipartConfig().getMaxRequestSize(),
+                        servlet.getMultipartConfig().getFileSizeThreshold());
+            }
         }
 
         for (FilterBuildItem filter : filters) {
diff --git a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/MultipartConfigTestCase.java b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/MultipartConfigTestCase.java
index 420218557f8..866c96e69b3 100644
--- a/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/MultipartConfigTestCase.java
+++ b/extensions/undertow/deployment/src/test/java/io/quarkus/undertow/test/MultipartConfigTestCase.java
@@ -6,6 +6,7 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 
+import javax.servlet.MultipartConfigElement;
 import javax.servlet.ServletException;
 import javax.servlet.annotation.MultipartConfig;
 import javax.servlet.annotation.WebServlet;
@@ -17,22 +18,38 @@
 import org.apache.commons.codec.Charsets;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
 
+import io.quarkus.builder.BuildContext;
+import io.quarkus.builder.BuildStep;
 import io.quarkus.test.QuarkusUnitTest;
+import io.quarkus.undertow.deployment.ServletBuildItem;
 
 public class MultipartConfigTestCase {
 
     @RegisterExtension
     static QuarkusUnitTest runner = new QuarkusUnitTest()
             .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
-                    .addClasses(MultipartServlet.class));
+                    .addClasses(MultipartServlet.class))
+            .addBuildChainCustomizer(b -> {
+                b.addBuildStep(new BuildStep() {
+                    @Override
+                    public void execute(BuildContext context) {
+                        context.produce(ServletBuildItem.builder("Test Servlet", MultipartServlet.class.getName())
+                                .addMapping("/servlet-item")
+                                .setMultipartConfig(new MultipartConfigElement(""))
+                                .build());
+                    }
+                }).produces(ServletBuildItem.class).build();
+            });
 
-    @Test
-    public void testMultipartConfig() {
+    @ParameterizedTest
+    @ValueSource(strings = { "/foo", "/servlet-item" })
+    public void testMultipartConfig(String path) {
         given().multiPart("file", "random.txt", "Some random file".getBytes(Charsets.UTF_8))
-                .when().post("/foo").then()
+                .when().post(path).then()
                 .statusCode(201)
                 .body(is("OK"));
     }
diff --git a/extensions/undertow/spi/src/main/java/io/quarkus/undertow/deployment/ServletBuildItem.java b/extensions/undertow/spi/src/main/java/io/quarkus/undertow/deployment/ServletBuildItem.java
index 7452477eddc..88df75142eb 100644
--- a/extensions/undertow/spi/src/main/java/io/quarkus/undertow/deployment/ServletBuildItem.java
+++ b/extensions/undertow/spi/src/main/java/io/quarkus/undertow/deployment/ServletBuildItem.java
@@ -6,6 +6,7 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.servlet.MultipartConfigElement;
 import javax.servlet.Servlet;
 
 import io.quarkus.builder.item.MultiBuildItem;
@@ -20,6 +21,7 @@ public final class ServletBuildItem extends MultiBuildItem {
     private final List<String> mappings;
     private final InstanceFactory<? extends Servlet> instanceFactory;
     private final Map<String, String> initParams;
+    private final MultipartConfigElement multipartConfig;
 
     private ServletBuildItem(Builder builder) {
         this.name = builder.name;
@@ -29,7 +31,7 @@ private ServletBuildItem(Builder builder) {
         this.mappings = Collections.unmodifiableList(new ArrayList<>(builder.mappings));
         this.instanceFactory = builder.instanceFactory;
         this.initParams = Collections.unmodifiableMap(new HashMap<>(builder.initParams));
-
+        this.multipartConfig = builder.multipartConfig;
     }
 
     public String getName() {
@@ -60,6 +62,10 @@ public InstanceFactory<? extends Servlet> getInstanceFactory() {
         return instanceFactory;
     }
 
+    public MultipartConfigElement getMultipartConfig() {
+        return multipartConfig;
+    }
+
     public static Builder builder(String name, String servletClass) {
         return new Builder(name, servletClass);
     }
@@ -72,6 +78,7 @@ public static class Builder {
         private List<String> mappings = new ArrayList<>();
         private InstanceFactory<? extends Servlet> instanceFactory;
         private Map<String, String> initParams = new HashMap<>();
+        private MultipartConfigElement multipartConfig;
 
         Builder(String name, String servletClass) {
             this.name = name;
@@ -136,6 +143,15 @@ public Builder addInitParam(String key, String value) {
             return this;
         }
 
+        public MultipartConfigElement getMultipartConfig() {
+            return multipartConfig;
+        }
+
+        public Builder setMultipartConfig(MultipartConfigElement multipartConfig) {
+            this.multipartConfig = multipartConfig;
+            return this;
+        }
+
         public ServletBuildItem build() {
             return new ServletBuildItem(this);
         }