Hey folks, I am trying to provide documentation/listing of rest services built with Spring MVC for a project. I ran across this example https://github.com/rstoyanchev/sprin...ontroller.java which exposes all the requestMappings.

What I would like to do is make a request to /doc/show and obtain a servletPath + requestMappingInfo.getPatternsCondition() for the mappings available. I can get context path from the request but haven’t found a way to get the getServletPath for a given url. What am I missing or is there an easier way to pull this information?

Code:
<servlet>
        <servlet-name>discovery</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>discovery</servlet-name>
        <url-pattern>/doc/*</url-pattern>
    </servlet-mapping>