context path vs servlet path?
http://localhost:8080/context/myServlet
If you look at the request URL for a servlet mapped at the path /myservlet, here http:// is the protocol, localhost is the server name, /context is the context path and /myServlet is the servlet path.
http://localhost:8080/context/myServlet/random
If you look at the request URL for a servlet mapped at the path /myservlet/*, here /myServlet is the servlet path and /random is extra path info...
ref : https://coderanch.com/t/474573/certification/ContextPath-ServletPath
spring boot's tomcat can only serve content below that context path
server.servlet.contextPath=/api/
Dispatcher servlet path allows you to register additional servlets on other paths
spring.mvc.servlet.path=/v1
spring.mvc.servlet.path=/v2
Two dispatch servlets active on:
http://localhost:8081/api/v1 and http://localhost:8081/api/v2
try accessing - http://localhost:8081/api/swagger-ui.html"
For Open API
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
swagger-ui location has moved from
http://host/context-path/swagger-ui.html
to
http://host/context-path/swagger-ui/index.html OR http://host/context-path/swagger-ui/
for short.
Reference https://springfox.github.io/springfox/docs/snapshot/