1

According to the documentation the default locations Spring will look for an index.html file are /static, /public, or /resources. I have been trying to alter my dir structure so that it will look in /src/xyzapp. I tried altering the spring.mvc.static-path-pattern in the application.properties to look like this:

spring.mvc.static-path-pattern=classpath:/src/xyzapp/

It doesn't seem to see the page I want to load though when I run the app. The page loaded normally when I had it in /static. Is my syntax off?

fun_hat
  • 547
  • 2
  • 7
  • 25
  • Do you know you should add the dir into `resources`? like `/resources/src/xyzapp`.. – Ali Dehghani Feb 07 '16 at 08:35
  • Anyway, your static resources after resource processing, should be in calsspath under `/src/xyzapp`. If by `src` you mean default source root of maven/gradle, it won't be in the classpath. – Ali Dehghani Feb 07 '16 at 08:47
  • Ak ok, I mean outside the resources dir. So is there a way to route to it without classpath then? Or a way to modify classpath? I was hoping to put it in Project/src/xyzapp rather than project/src/main/resources/xyzapp. – fun_hat Feb 07 '16 at 22:33
  • check this answer http://stackoverflow.com/questions/21123437/how-do-i-use-spring-boot-to-serve-static-content-located-in-dropbox-folder – David Mar 20 '16 at 05:43

0 Answers0