Add a location / images, which is displayed on / tmp
Accordingly, the url of the pictures will be of this type http: // server: port / images / usr1 / image1.png
Added the <location name="/images" handler="images-content"/> and the corresponding handler <file name="images-content" path="/tmp"/> standalone.xml
<subsystem xmlns="urn:jboss:domain:undertow:2.0"> <buffer-cache name="default"/> <server name="default-server"> <http-listener name="default" socket-binding="http" redirect-socket="https"/> <host name="default-host" alias="localhost"> <location name="/" handler="welcome-content"/> <location name="/images" handler="images-content"/> <filter-ref name="server-header"/> <filter-ref name="x-powered-by-header"/> </host> </server> <servlet-container name="default"> <jsp-config/> <websockets/> </servlet-container> <handlers> <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> <file name="images-content" path="/tmp"/> </handlers> <filters> <response-header name="server-header" header-name="Server" header-value="WildFly/9"/> <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/> </filters> </subsystem>
Important. Such pictures will be available to all. Those. usr1 can spy on usr2 pictures and vice versa.
If you need to hide from each other, then you need a completely different solution - Servlet.