Specify user handlers for JAX-RS when using annotation scanning

242 views Asked by At

How to specify user handlers for JAX-RS when using annotation scanning?

I am following this link and have created my custom handlers. I have annotated my Application subclass as:

@ApplicationPath("rest")
        public class RestfulResourceLoader extends Application {
}

so that I don't have to entry in web.xml file. What I am not able to find out is where to specify the property file which contains this entry:

wink.handlersFactoryClass=mobile.handler.MyCustomHandler

I am using Liberty Profile 8.5.5.2 with jaxrs-1.1 feature.

1

There are 1 answers

3
Iris Ding On BEST ANSWER

I am afraid you can only define this via web.xml file. This is also the way WINk supported. In your case, even if you have @ApplicationPath("rest") defined,you can also have a web.xml.