Reply To: Command not fired with multipart form (JSF 2.2)

Splash Forums PrettyFaces Users Command not fired with multipart form (JSF 2.2) Reply To: Command not fired with multipart form (JSF 2.2)


Janario Oliveira

Hi, I tried in 2.0.12.Final and also in 2.0.13.Final-SNAPSHOT. Same happens.

It works with this workaround:

1 – Add undertow-servlet as provided dependency:

            <version>1.0.0.Final</version><!--same version o wildfly-->

2 – extends DefaultServlet from undertow and add @MultipartConfig

@WebServlet(name = io.undertow.servlet.handlers.ServletPathMatches.DEFAULT_SERVLET_NAME, urlPatterns = "/*")
public class MultipartDefaultServlet extends io.undertow.servlet.handlers.DefaultServlet { }

After that the parameters will appears in the filter and also be able to invoke jsf actions.

The problem is that WildFly associate a parser according to the servlet mapped

  io.undertow.server.handlers.form.FormEncodedDataDefinition always added
  io.undertow.server.handlers.form.MultiPartParserDefinition only added in multipart servlets, DefaultServlet doesn't handle multipart.

If I map FacesServlet to same pattern of URLMapping FacesServlet will handle multipart.

Trying to reproduce(without the workaround) I create a simple html(multipart.html) and try to see the parameters in a WebFilter

<form enctype="multipart/form-data" method="post">
    <input name="testeParam" value="testeValue"/>
    <input type="submit"/>

@WebFilter(urlPatterns = "/*")
public class TestFilter implements Filter {

The parameters are always empty. In JBoss same happens but when it is a request of a rewrite mapped(URLMapping) the parameters came in the filter.

So, What do you think? Is it a bug in WildFly? but in basic sample(multipart.html) parameters are empty even in JBoss