Search code examples
jakarta-eejava-8jerseyglassfish

Jersey: Disable automatic Wadl Generation for OPTIONS request without using a web.xml file?


I want to accomplish the same thing as this question: Disable automatic Wadl Generation for OPTIONS request, but we don't have a web.xml file. We also make use of ResourceConfig, where the getProperties method is final, so I cannot override that as suggested in other questions. I've tried calling property("com.sun.jersey.config.feature.DisableWADL", "true"); in our class that extends ResourceConfig, but that didn't work.

How can I disable WADL?

We're using Jersey 2.25.1. I tried reading the Jersey docs on WADL, but was unable to read the page because of a popup error message saying something about syntaxhighlightingerror/xml brush.


Solution

  • You're using the wrong property. Anything you see with com.sun.jersey is going to be for Jersey 1.x. The one you want is jersey.config.server.wadl.disableWadl, or better yet just use the constant.

    ServerProperties.WADL_FEATURE_DISABLE