Class PrimefacesFileUploadServletContextAutoConfiguration


  • @Configuration(proxyBeanMethods=false)
    @ConditionalOnClass(org.primefaces.webapp.MultipartRequest.class)
    @ConditionalOnWebApplication(type=SERVLET)
    @AutoConfigureAfter(JavaxFacesAutoConfiguration.class)
    public class PrimefacesFileUploadServletContextAutoConfiguration
    extends java.lang.Object
    Jetty does not resolve part parameters without associating a multipart config to corresponding servlet. This configuration needed to manually add that configuration and native file upload of JSF can work. This configuration is also possible with using jetty-annotations module. Since FacesServlet is annotated with MultipartConfig. FileUploadFilter bean is needed for requests to be wrapped as a MultipartRequest. Finally multipart configuration properties are borrowed and set up from spring's MultipartProperties
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.primefaces.webapp.filter.FileUploadFilter fileUploadFilter()
      File upload filter is required only if commons fileupload is chosen.
      org.springframework.boot.web.servlet.ServletContextInitializer primefacesFileUploadServletContextInitializer​(javax.servlet.MultipartConfigElement multipartConfigElement)
      PrimefacesFileUploadServletContextInitializer for native uploader, since FileUploadFilter suffices for commons file uploader.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrimefacesFileUploadServletContextAutoConfiguration

        public PrimefacesFileUploadServletContextAutoConfiguration()
    • Method Detail

      • primefacesFileUploadServletContextInitializer

        @ConditionalOnExpression("\'${joinfaces.primefaces.uploader}\' != \'commons\'")
        @Bean
        public org.springframework.boot.web.servlet.ServletContextInitializer primefacesFileUploadServletContextInitializer​(javax.servlet.MultipartConfigElement multipartConfigElement)
        PrimefacesFileUploadServletContextInitializer for native uploader, since FileUploadFilter suffices for commons file uploader.
        Parameters:
        multipartConfigElement - MultipartAutoConfiguration.multipartConfigElement()
        Returns:
        primefaces file upload servlet context initializer
      • fileUploadFilter

        @Bean
        @ConditionalOnProperty(value="joinfaces.primefaces.uploader",
                               havingValue="commons")
        public org.primefaces.webapp.filter.FileUploadFilter fileUploadFilter()
        File upload filter is required only if commons fileupload is chosen.
        Returns:
        file upload filter