throw new IllegalStateException("Cannot load keystore", e);
}
connector.setAttribute("clientAuth", "false");
connector.setAttribute("sslProtocol", "TLS");
connector.setAttribute("SSLEnabled", true);
});
}
}
};
}
```
## Reload Static Content (E.g. Thymeleaf Templates) Without Restarting the Container
If you are using Thymeleaf, then set
@ -195,7 +250,6 @@ Applications that are not already Spring applications might be
@@ -195,7 +250,6 @@ Applications that are not already Spring applications might be
convertible to a Spring Boot application, and the guidance above might
help, but your mileage may vary.
## Serve Static Content
Spring Boot by default will serve static content from a folder called
@ -252,6 +306,23 @@ For more detail look at the
@@ -252,6 +306,23 @@ For more detail look at the
The Actuator installs a "whitelabel" error page that you will see in
browser client if you encounter a server error (machine clients
consuming JSON and other media types should see a sensible response
with the right error code). To switch it off you can set
`error.whitelabel.enabled=false`, but normally in addition or
alternatively to that you will want to add your own error page
replacing the whitelabel one. If you are using Thymeleaf you can do
this by adding an "error.html" template. In general what you need is a
`View` that resolves with a name of "error", and/or a `@Controller`
that handles the "/error" path. Unless you replaced some of the
default configuration you should find a `BeanNameViewResolver` in your
`ApplicationContext` so a `@Bean` with id "error" would be a simple
way of doing that. Look at `ErrorMvcAutoConfiguration` for more
options.
## Use 'Short' Command Line Arguments
Some people like to use (for example) `--port=9000` instead of
@ -361,6 +432,89 @@ to load an `ApplicationContext` via a `DispatcherServlet`.
@@ -361,6 +432,89 @@ to load an `ApplicationContext` via a `DispatcherServlet`.
TODO: add some detail.
## Configure a DataSource
Spring Boot will create a `DataSource` for you if you have
`spring-jdbc` and some other things on the classpath. Here's the
algorithm for choosing a specific implementation.
* We prefer the Tomcat pooling `DataSource` for its performance and
concurrency, so if that is available we always choose it.
* If commons-dbcp is available we will use that, but we don't
recommend it in production.
* If neither of those is available but an embedded database is then we
create one of those for you (preference order is h2, then Apache
Derby, then hsqldb).
The pooling `DataSource` option is controlled by external
configuration properties in `spring.datasource.*` for example: