I am trying to change the default location for the Part "write" function.
I tried directly in my servlet : @MultipartConfig(location="/web/files/")
and also in my web.xml file :
<servlet-name>pictureController</servlet-name>
<servlet-class>fr.beans.PictureController</servlet-class>
<multipart-config>
<location>/web/files</location>
<max-file-size>20848820</max-file-size>
<max-request-size>418018841</max-request-size>
<file-size-threshold>1048576</file-size-threshold>
</multipart-config>
Then to save the uploaded file :
file.write(file.getSubmittedFileName());
But neither are working, it keeps saving the files in a generated Glassfish directory, something like /opt/glassfish-4.1.1/glassfish/domains/domain1/generated/jsp/
Is there something wrong with my configuration?