• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

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

 
Ranch Hand
Posts: 391
1
MySQL Database PHP Java
  • 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
 
Ranch Hand
Posts: 1738
12
  • 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.
 
Saloon Keeper
Posts: 2613
329
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • 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.
 
Creator of Enthuware JWS+ V6
Posts: 3285
296
Android Eclipse IDE Chrome
  • 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
Saloon Keeper
Posts: 2613
329
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • 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
MySQL Database PHP Java
  • 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
Posts: 3285
296
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check Jersey Deploying a RESTful Web Service.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!