5

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?

2 Answers2

2

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> 
kent_e
  • 111
  • 1
  • 7
1

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>
Malcolm Smith
  • 3,540
  • 25
  • 29
  • I'm having trouble with this right now. Setting this property to true causes hk2 to throw an "UnsatisfiedDependencyException" during startup, because it can't find a WadlApplicationContext. Do you know what might cause this? – marstran Sep 20 '19 at 14:40