I've been migrating a web application from JBoss 7.1 to embedded tomcat and one of our pages is not working properly. The system save an image file in a tmp folder and this file should be accessed like this:
http://localhost:8080/myapplication/myfolder/name.png
I don't know why embedded tomcat doesn't find the img in this folder ("java.io.tmpdir"). Actually, I'm pretty sure that it is not looking for this picture in this folder.
How can I set tomcat up to look into this folder?
My project currently uses Spring Boot 1.5.3, Struts 2.3.34 and embedded tomcat 8.5.5.
Sorry, the answer here is not something you are going to like.
What you are describing is generally considered a serious security risk and is highly discouraged.
First having any details about your file system (even minor ones like this) in the public URL is not considered a good idea.
Secondly generally app servers will not allow disk access out side the app folder and even in the application context folder is discouraged. Besides serious security problems it also creates a lot of administrative headaches like managing diskspace, archiving, deleting, etc. Which is why of of the box Tomcat is going to block that.
The generally accepted way to save files is save them in a database, or caching server.