Is there a way (e.g. from a WildFly management console) to list all REST endpoints deployed in WildFly? Or to list them in a log while a server is starting?
相关问题
- Design RESTful service with multiple ids
- Axios OPTIONS instead of POST Request. Express Res
- Plain (non-HTML) error pages in REST api
- How do I delay JMS Message sending?
- Laravel 5.1 MethodNotAllowedHttpException on store
相关文章
- @Singleton @Startup @PostConstruct method guarante
- Is it possible to destroy a CDI scope?
- The JavaEE 8 Tutorial, deploy failed on hello1 pro
- Got ActiveRecord::AssociationTypeMismatch on model
- Multiple parameters in AngularJS $resource GET
- Inject producer method that returns String CDI
- Global Exception Handling in Jersey & Spring?
- Why does Google Chrome NOT use cached pages when I
From the Management Console, you can view the published endpoints.
When you login as an administrator, Click the Runtime option on the top navigation bar as shown below.
Click the JAX-RS option, then click the REST Resources option. This will display the endpoints to the far right.
Using the
RegistryStatsResource
With RESTEasy (that is shipped with WildFly), you could add the following to your
web.xml
:And then request the following URL:
Such endpoint can produce XML and JSON content. Just add the
Accept
header to the request with the desired media type:application/xml
application/json
Checking the source code
If you are interested in the source code to create your own implementation, have a look at the
RegistryStatsResource
class on GitHub.The most relevant part of the source code is shown below (it's RESTEasy specific):
Swagger may be an alternative
Depending on your requirements, you can use Swagger to document your API. It comes with a set of annotations to describe your REST endpoints.
Then use Swagger UI to provide a live documentation for your API.
Note: As of February 2017, looks like the
RegistryStatsResource
class is completely undocumented. I occasionally discovered it when digging into the RESTEasy source code for debugging purposes. Also, I found this JBoss EAP issue that tracks the lack of documentation for that class.