Error "Failed to process parts because a multicomponent configuration was not provided" when loading a file

I am trying to upload a file through a form in a JSP file, but I am getting this error. The servlet already has the @MultipartConfig notation. I am using servlet 3.0 and apache tomcat 8.

Error message:

java.lang.IllegalStateException: Unable to process parts as no multi-part configuration has been provided 

in line

 Collection<Part> parts = request.getParts();` 
+6
source share
1 answer

I had to add

 allowCasualMultipartParsing="true" 

in the context tag inside context.xml

+16
source

Source: https://habr.com/ru/post/971776/


All Articles