Description
This issue effects only spring-boot.
<tc:in label="Name" value="#{helloSpring.name}" required="true"> <f:facet name="after"> <tc:button label="Submit" defaultCommand="true" action="#{helloSpring.sayHello}"/> </f:facet> </tc:in> <tc:file/>
public String sayHello() { LOG.info("Action was called, name is '{}'", name); return "/result.xhtml"; }
Solution:
put this code in the Application.java
@Bean public ServletContextInitializer multipartServletContextInitializer(MultipartConfigElement multipartConfigElement) { return servletContext -> { ServletRegistration servletRegistration = servletContext.getServletRegistration(FACES_SERVLET_NAME); if (servletRegistration instanceof ServletRegistration.Dynamic) { ((ServletRegistration.Dynamic) servletRegistration).setMultipartConfig(multipartConfigElement); } }; }
The FacesServlet needs to support <multipart-config> usually set in the web.xml.
(its now as example in the sping-boot demo)