In Attachments we also implement a scenario where multiple files can be uploaded. However we have limited by design the upload widget on the UI side to take only one file at a time. For your reference here is the method signature of the upload controller.
As you can see here the various MultipartFile
objects are gotten from the encompassing MultipartHttpServletRequest
instance.
P.S. Btw is Attachments not of any use for your use case?
With another module depending on Core 2.x and in another context I have also come across a dependency issue once with javax.servlet. I was surprised that the one from Core was not being picked up. I “solved” it by forcing the dependency right away in my OMOD subproject’s POM. To make things work it had to be the first dependency in line, so even before openmrs-api. The omod/pom.xml looks like that:
<dependencies>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>${project.parent.artifactId}-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openmrs.api</groupId>
<artifactId>openmrs-api</artifactId>
<version>${openMRSVersion}</version>
<scope>provided</scope>
<type>jar</type>
</dependency>
...