Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to auto configure MultipartConfigElement? #315

Open
mayur9991 opened this issue Apr 5, 2024 · 5 comments
Open

How to auto configure MultipartConfigElement? #315

mayur9991 opened this issue Apr 5, 2024 · 5 comments

Comments

@mayur9991
Copy link

Spring Boot includes MultipartAutoConfiguration, which automatically configures the MultipartConfigElement on the Spring Dispatcher Servlet.

Could you provide guidance on configuring this feature when using the Resteasy Spring Boot Starter?

@liweinan
Copy link
Contributor

liweinan commented Apr 5, 2024

@mayur9991 I guess you are asking the MultipartConfigElement support in RESTEasy context. Here is how the RESTEasy uses the MultipartConfigElement:

if (multipartConfig != null) {
            reg.setMultipartConfig(new MultipartConfigElement(multipartConfig));
}

@mayur9991
Copy link
Author

I expected it to auto configure as spring does it with MultipartAutoConfiguration. However, that is not the case with resteasy-servlet-spring-boot-starter library.

@liweinan
Copy link
Contributor

With my understanding the resteasy-spring-boot also uses the ServletInitializer internally from RESTEasy. I'll check this.

@liweinan
Copy link
Contributor

I'm looking at the detail implementations between resteasy-spring-boot and resteasy and also the spring side. It may needs some time.

@liweinan
Copy link
Contributor

liweinan commented May 4, 2024

I have checked the implementation of: https://github.com/resteasy/resteasy-spring-boot/blob/main/servlet/resteasy-servlet-spring-boot-starter/src/main/java/org/jboss/resteasy/springboot/ResteasyBeanProcessorTomcat.java

And seems it doesn't have the similar logic in:

        final MultipartConfig multipartConfig = applicationClass.getAnnotation(MultipartConfig.class);
        if (multipartConfig != null) {
            reg.setMultipartConfig(new MultipartConfigElement(multipartConfig));
        }

I will think about a solution on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants