Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Whats the use of javax.ws.rs.core.Application class

 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see JAX-RS code where class extends Application. Whats the use of Application class.



Request URL http://localhost:8080/AllMethods/app/root/greet gives hello

But why to use Application class ?

I am using Jersey 1.19
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the Application class is used as a starting point for accessing the Restful service.
I am not sure about that.
 
Ron McLeod
Bartender
Pie
Posts: 1047
65
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Application holds references to the JAX-RS resources, providers, and other configuration-related data. Jersey has ResourceConfig, which is an subclass of Application.

Also, if you are starting a new project, you should probably be looking at Jersey 2.x.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, if you are starting a new project, you should probably be looking at Jersey 2.x

However for the OCEWSD6 certification, only JAX-RS 1.x (and Jersey 1.x) is required.
 
Ron McLeod
Bartender
Pie
Posts: 1047
65
Android Eclipse IDE Java Linux MySQL Database Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frits Walraven wrote:However for the OCEWSD6 certification, only JAX-RS 1.x (and Jersey 1.x) is required.

Ahh - I didn't notice that this was in the WS certification forum - thanks.
 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading the JAX-RS 1.5 docs. Which explains different ways of deploying the JAX-RS services

Thats what docs says


Deployment of your application using web.xml with Servlet 3.0

1 <web-app>
2 <servlet>
3 <servlet-name>Jersey Web Application</servlet-name>
4 <servlet-class>MyApplication</servlet-class>
5 </servlet>
6 ....



So I tried below example , I am using Jersey 1.9 and Tomcat 7









But on requesting the resource class ( http://localhost:8080/DeployingJAX-RS/callMe/message ) I get 404.

What I am missing ?

 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check Jersey Deploying a RESTful Web Service.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic