title: List of properties available for application.properties in Spring Boot?
body: <p>Spring Boot document says that we can set properties in application.properties file.<br>
  But I cannot find a document that lists available properties that can be set.<br>
  Where can I find such a document?<br></p>
  
  <p>For example, I want to set documentRoot for embedded servlet.<br>
  I found that the setDocumentRoot() method is implemented in AbstractEmbeddedServletContainerFactory.java.<br>
  But I don't know when or where to call the method, or the name of property that can be set in application.properties.<br>
  I think it should be easy, since Spring Boot's very purpose is to ease the configuration.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>UPDATE:</strong><br></p>
  
  <p>As M. Deinum sugggested, I added 'server.document-root: someDirectoryName' to the application.properties, but following error occured.</p>
  
  <pre><code>Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'document-root' of bean class [org.springframework.boot.context.embedded.properties.ServerProperties]: Bean property 'document-root' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
      at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1057)
      at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:915)
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:82)
      at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:730)
      at org.springframework.validation.DataBinder.doBind(DataBinder.java:626)
      at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:78)
      at org.springframework.validation.DataBinder.bind(DataBinder.java:611)
      at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:232)
      at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:204)
      at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessAfterInitialization(ConfigurationPropertiesBindingPostProcessor.java:312)
      ... 31 more
  </code></pre>
  
  <p>I think it is because of the way org.springframework.boot.context.embedded.properties.ServerProperties implemented. (See <a href="https://github.com/spring-projects/spring-boot/blob/97cb7f096798ecd016de71f892fa55585d45f5eb/spring-boot/src/main/java/org/springframework/boot/context/embedded/properties/ServerProperties.java">https://github.com/spring-projects/spring-boot/blob/97cb7f096798ecd016de71f892fa55585d45f5eb/spring-boot/src/main/java/org/springframework/boot/context/embedded/properties/ServerProperties.java</a>)<br></p>
  
  <p>It declares '@ConfigurationProperties(name = "server", ignoreUnknownFields = false)'.
  So, it manages the application properties that starts with 'server', and disallowes unknown property name.<br>
  And it does not support documentRoot getter/setter.<br></p>
  
  <p>BTW, ServerProperties class is made to a Bean by  org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration (See <a href="https://github.com/spring-projects/spring-boot/blob/97cb7f096798ecd016de71f892fa55585d45f5eb/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.java">https://github.com/spring-projects/spring-boot/blob/97cb7f096798ecd016de71f892fa55585d45f5eb/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.java</a>) so that it can participate in the configuration process.</p>
  
  <p>So, I tried to implement ServerProperties-like one and ServerPropertiesAutoConfiguration-like one myself.<br>
  The code is as follows:</p>
  
  <pre><code>package com.sample.server;
  
  import java.io.File;
  
  import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainerFactory;
  import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
  import org.springframework.boot.context.properties.ConfigurationProperties;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  
  @Configuration
  public class SampleConfiguration
  {
      @Bean
      public SampleServerProperties sampleServerProperties()
      {
          return new SampleServerProperties();
      }
  
      @ConfigurationProperties(name = "sample.server")
      public static class SampleServerProperties
          implements EmbeddedServletContainerCustomizer 
      {
          private String documentRoot;
          public String getDocumentRoot()
          {
              return documentRoot;
          }
          public void setDocumentRoot(String documentRoot)
          {
              System.out.println("############## setDocumentRoot");
              this.documentRoot = documentRoot;
          }
  
          @Override
          public void customize(ConfigurableEmbeddedServletContainerFactory factory)
          {
              if (getDocumentRoot() != null)
              {
                  factory.setDocumentRoot(new File(getDocumentRoot()));
              }
          }
      }
  }
  </code></pre>
  
  <p>And added following line to application.properties.</p>
  
  <p>sample.server.documentRoot: someDirectoryName</p>
  
  <p>...And it works!<br></p>
  
  <p>"############## setDocumentRoot" is printed to the console, and the document root is actually set.</p>
  
  <p>So, I'm happy now, but is this the right way to do it?</p>