Where are the Embedded Tomcat configuration files for spring-boot-starter-web? I want to set autoDeploy="true" to make the Embedded Tomcat hot deploy changes to my html files.
- are you using maven in your project to download the depnedencies?pd30– pd302014-09-27 03:52:32 +00:00Commented Sep 27, 2014 at 3:52
- docs.spring.io/spring-boot/docs/current/reference/htmlsingle/…geoand– geoand2014-09-27 05:53:03 +00:00Commented Sep 27, 2014 at 5:53
- I suppose changing html files doesn't require autoDeployhsluo– hsluo2014-09-27 08:13:50 +00:00Commented Sep 27, 2014 at 8:13
- @hsluo - HTML files require a redeploy w/ the embedded container.szxnyc– szxnyc2014-09-29 01:08:39 +00:00Commented Sep 29, 2014 at 1:08
Add a comment |
1 Answer
An embedded container has no notion of an autoDeploy (that's a container feature that applies to deployed war files). If you just want to reload static resources at dev time, the docs are here: http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-hotswapping
3 Comments
fongfong
Hi Dave, Our spring-boot app (web) consumes static contents (.html, .jsp, images, .css etc.) that is a mounted path from an external. We noticed that our spring-boot app reflects ONLY when there is a NEW jsp file or other static files dropping in that mounted directory, we can see the change from browser. However, if a static file is UPDATED, browser does not reflect until we restart the app. Besides using
spring-boot-devtools for PROD, is there a way to configure it without restarting? We use embedded tomcat, configured server.tomcat.context.preresources.base=/external/contents/ Thanks!Dave Syer
Did you try
spring.resources.static-locations=file:///path/to/external/contents? (I don't think server.tomcat.context.preresources.base does anything at all in a vanilla Spring Boot app. Maybe you tweaked it?)fongfong
Thank you for your reply! Let me try that.
spring.resources.static-locations=file:///path/to/external/contents