问题
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