Can be obtained at runtime the struts.multipart.maxSize
value defined in struts.xml
?
using Struts2
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24.1</version>
</dependency>
It could be done the following way. Add this code to the action or bean managed by Struts container. For other beans you should use the container to inject dependencies.
private String multipartMaxSize;
@Inject(StrutsConstants.STRUTS_MULTIPART_MAXSIZE)
public void setMultipartMaxSize(String multipartMaxSize) {
this.multipartMaxSize = multipartMaxSize;
}