Class PrimefacesFileUploadServletContextAutoConfiguration
- java.lang.Object
-
- org.joinfaces.autoconfigure.primefaces.PrimefacesFileUploadServletContextAutoConfiguration
-
@Configuration(proxyBeanMethods=false) @ConditionalOnClass(org.primefaces.webapp.MultipartRequest.class) @AutoConfigureAfter(JavaxFacesAutoConfiguration.class) public class PrimefacesFileUploadServletContextAutoConfiguration extends 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. SinceFacesServlet
is annotated withMultipartConfig
.FileUploadFilter
bean is needed for requests to be wrapped as aMultipartRequest
. Finally multipart configuration properties are borrowed and set up from spring'sMultipartProperties
-
-
Constructor Summary
Constructors Constructor Description PrimefacesFileUploadServletContextAutoConfiguration()
-
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, sinceFileUploadFilter
suffices for commons file uploader.
-
-
-
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, sinceFileUploadFilter
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
-
-