我想完成与这个问题相同的事情:Disable automatic Wadl Generation for OPTIONS request ,但我们没有 web.xml
文件。我们还使用了 ResourceConfig
,其中 getProperties
方法是 final方法,因此我无法按照 other questions 中的建议覆盖它.我试过在扩展 ResourceConfig
的类中调用 property("com.sun.jersey.config.feature.DisableWADL", "true");
,但这并没有'工作。
如何禁用 WADL?
我们正在使用 Jersey 2.25.1。我试着阅读 the Jersey docs on WADL , 但由于弹出错误消息说有关 syntaxhighlightingerror/xml brush 的内容而无法阅读该页面。
最佳答案
您使用了错误的属性。您在 com.sun.jersey
中看到的任何内容都将适用于 Jersey 1.x。您想要的是 jersey.config.server.wadl.disableWadl
,或者更好的是只使用常量。
关于jakarta-ee - Jersey:在不使用 web.xml 文件的情况下禁用 OPTIONS 请求的自动 Wadl 生成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47095587/