You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Carsten Dimmek (Jira)" <de...@myfaces.apache.org> on 2022/12/09 08:23:00 UTC

[jira] [Commented] (TOBAGO-2178) An action is not executed if tc:file is on page (spring-boot)

    [ https://issues.apache.org/jira/browse/TOBAGO-2178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17645158#comment-17645158 ] 

Carsten Dimmek commented on TOBAGO-2178:
----------------------------------------

The problem stems from a missing multipart config in SpringBoot/Joinfaces. I have created a ticket for this in the Jonfaces project

[https://github.com/joinfaces/joinfaces/issues/1620]

and a PR https://github.com/joinfaces/joinfaces/pull/1621

> An action is not executed if tc:file is on page (spring-boot)
> -------------------------------------------------------------
>
>                 Key: TOBAGO-2178
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-2178
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 5.3.0
>            Reporter: Henning Nöth
>            Assignee: Udo Schnurpfeil
>            Priority: Critical
>             Fix For: 5.4.0
>
>
> This issue effects only spring-boot.
> {code:xml}
> <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/>
> {code}
> {code:java}
> public String sayHello() {
>   LOG.info("Action was called, name is '{}'", name);
>   return "/result.xhtml";
> }
> {code}
> Solution:
> put this code in the Application.java
> {code}
>   @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);
>       }
>     };
>   }
> {code}
> The FacesServlet needs to support <multipart-config> usually set in the web.xml.
> (its now as example in the sping-boot demo)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)