Disable automatic Wadl Generation for OPTIONS request

邮差的信 提交于 2019-12-10 15:03:24

问题


I'm having trouble disabling automatic Wadl Generation in Jersey every time an OPTIONS request is received. I've tried adding the following to the servlet configuration in web.xml but it doesn't work:

<init-param>
    <param-name>jersey.config.server.wadl.disableWadl</param-name>
    <param-value>true</param-value>
</init-param>

Can anyone help?


回答1:


Just ran into this problem myself and it looks like you need to make sure the capitalization is correct for it to work: com.sun.jersey.config.feature.DisableWADL. Put this entry in your web.xml file in the jersey-servlet <servlet> section.

<init-param>
     <param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
     <param-value>true</param-value>
</init-param> 



回答2:


Not sure when it changed, but on Jersey 2.28 this parameter is now jersey.config.server.wadl.disableWadl

So you want:

    <init-param>
        <param-name>jersey.config.server.wadl.disableWadl</param-name>
        <param-value>true</param-value>
    </init-param>


来源:https://stackoverflow.com/questions/32330770/disable-automatic-wadl-generation-for-options-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!