Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-279

ServletRegistration.Dynamic.setMultipartConfig(MultipartConfigElement ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.1.Beta4
    • 1.1.Beta3
    • Servlet
    • None
    • Compatibility/Configuration

      If I add a servlet programmatically via ServletContext.addServlet and also set a MultiPartConfig to allow file upload, the multipartconfig is ignored:

      ServletRegistration.Dynamic registration = servletContext.addServlet("myservlet", new MyServlet());
      registration.setMultipartConfig(new MultipartConfigElement(...));
      

      As far as I can see the flow of events is as follows:

      • servletcontext.addServlet() will create a undertow ServletInfo and a ManagedServlet based on that ServletInfo.
      • ManagedServlet does not find a MultiPartConfig in the ServletInfo and therefore does not have a multipart parser.
      • The following call registration.setMultipartConfig() does not have any effect for the ManagedServlet

      This does not affect Servlets which specify a multipartconfig via an annotation which is picked up by the ServletInfo.

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              javalanche_jira Johannes D (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: