Is there a way to retrieve information about spring mappings defined by @Controller?

后端 未结 2 1528
误落风尘
误落风尘 2021-02-06 07:47

I\'d like to be able to create a page that lists off the mappings that were discovered by controllers annotated with @Controller. I\'m doing this for REST services

相关标签:
2条回答
  • 2021-02-06 08:03

    Check out this custom doclet https://github.com/rightshift/spring-mvc-api-doclet. It will create endpoint documentation for all Spring MVC @Controller annotated classes. Custom templates can be created to produce different HTML output. The new template name just needs to be passed as an optional param. It can also be added to as a reportSet to the reporting section of your maven pom.

    0 讨论(0)
  • 2021-02-06 08:07

    With Spring 3.1, there is a new feature referred to as "end point documentation". The only thing I could find was some code in the spring-mvc-31-demo sample app. Refer to the example controller and JSP. Seems pretty straight forward.

    0 讨论(0)
提交回复
热议问题