title: How to set spring dispatcherServlet path?
body: <p>I use <em>application.properties</em> file to set <code>DispatcherServlet</code> path:</p>
  
  <pre><code>server.servlet.path=/api/
  </code></pre>
  
  <p>When I go to url <code>/api/</code>, I get this exception:</p>
  
  <pre><code>Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'servlet[path]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Bean property 'servlet[path]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
      at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:731)
      at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:948)
      ... 59 common frames omitted
  </code></pre>
  
  <p>How to set DispatcherServlet path?</p>