我想完成与此问题相同的事情:Disable automatic Wadl Generation for OPTIONS request,但我们没有web.xml
个文件。我们还使用ResourceConfig
,其中getProperties
方法是最终的,因此我无法按照other questions中的建议覆盖它。我尝试在property("com.sun.jersey.config.feature.DisableWADL", "true");
的课程中致电ResourceConfig
,但这不起作用。
如何禁用WADL?
我们正在使用Jersey 2.25.1。我尝试阅读the Jersey docs on WADL但由于弹出错误消息说明了syntaxhighlightingerror / xml画笔,因此无法读取页面。
答案 0 :(得分:4)
你使用的是错误的财产。你在com.sun.jersey
看到的任何东西都将用于Jersey 1.x.你想要的是jersey.config.server.wadl.disableWadl
,或者更好,只需使用常量。