1

I have a Spring MVC app that is generally an image viewer that runs on Wildfly.

Images are created dinamically and are saved into nginx folder /usr/share/nginx/html/images.

How could I map Spring MVC app with that folder to be able to load images from it eg. map the folder to localhost:8080/mySpringApp/images?

Answer from this thread should be the way to go but the standalone.xml is always overwritten when starting the app from IntelliJ.

Community
  • 1
  • 1
CAPS LOCK
  • 1,960
  • 3
  • 26
  • 41

1 Answers1

1

You can follow the spring-mvc route all the way. When you are configuring the mappings for your static resources as explained here

You can state a file system location e.g.

registry.addResourceHandler("/images/**").addResourceLocations("file:////usr/share/nginx/html/images/");

or configure based on the XML equivalent

Master Slave
  • 27,771
  • 4
  • 57
  • 55