Hi,
I have created sample project in eclipse and deployed it in tomcat.
I am using below jar files.
asm-3.1.jarjersey-core-1.10.jarjersey-server-1.10.jarjersey-servlet-1.10.jar
below are classes.
and
my web.xml
My Doubts
1. How does Jersey framework inject/scan JAX-RS resources. if we don't provide class names explicitly
2. Some docs says (links are provided below), we have to explicitly register package name to tell Jersey framework so it can scan those packages and inject AX-RS resources.
Link 1 :
https://jersey.java.net/documentation/latest/deployment.html#deployment.servlet.2
Link 2 :
http://docs.oracle.com/cd/E19776-01/820-4867/ggnxs/index.html
even if I remove method getClasses() from class MyApplication, It is working fine. My doubt is how does it finds resource HelloWorldResource.java ?
This is my Tomcat’s catalina.out logfile's snap:
In above code I do not explicitly tell framework to register my class HelloWorldResource as I have commented getClasses method.
Does it scan by annotation like @Path("helloworld") @Produces("text/plain") ?
Thanks,
Niraj